@naturalcycles/nodejs-lib 15.111.0 → 15.112.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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Transform } from 'node:stream';
|
|
2
2
|
import type { ReadableStream as WebReadableStream } from 'node:stream/web';
|
|
3
3
|
import type { ZlibOptions, ZstdOptions } from 'node:zlib';
|
|
4
|
-
import type { AbortableAsyncMapper, AsyncIndexedMapper, AsyncPredicate, END, IndexedMapper, Integer, NonNegativeInteger, PositiveInteger, Predicate, SKIP } from '@naturalcycles/js-lib/types';
|
|
4
|
+
import type { AbortableAsyncMapper, AbortableMapper, AsyncIndexedMapper, AsyncPredicate, END, IndexedMapper, Integer, NonNegativeInteger, PositiveInteger, Predicate, SKIP } from '@naturalcycles/js-lib/types';
|
|
5
5
|
import type { ReadableTyped, TransformOptions, TransformTyped, WritableTyped } from './stream.model.js';
|
|
6
6
|
import type { TransformLogProgressOptions } from './transform/transformLogProgress.js';
|
|
7
7
|
import type { TransformMapOptions } from './transform/transformMap.js';
|
|
@@ -68,8 +68,8 @@ export declare class Pipeline<T = unknown> {
|
|
|
68
68
|
filter(asyncPredicate: AsyncPredicate<T>, opt?: TransformMapOptions): this;
|
|
69
69
|
filterSync(predicate: Predicate<T>, opt?: TransformOptions): this;
|
|
70
70
|
offset(opt: TransformOffsetOptions): this;
|
|
71
|
-
tap(fn: AsyncIndexedMapper<T,
|
|
72
|
-
tapSync(fn: IndexedMapper<T,
|
|
71
|
+
tap(fn: AsyncIndexedMapper<T, void>, opt?: TransformOptions): this;
|
|
72
|
+
tapSync(fn: IndexedMapper<T, void>, opt?: TransformOptions): this;
|
|
73
73
|
throttle(opt: TransformThrottleOptions): this;
|
|
74
74
|
throttleByRSS(opt: TransformThrottleByRSSOptions): this;
|
|
75
75
|
/**
|
|
@@ -113,7 +113,7 @@ export declare class Pipeline<T = unknown> {
|
|
|
113
113
|
*/
|
|
114
114
|
toNDJsonFile(outputFilePath: string, level?: Integer): Promise<void>;
|
|
115
115
|
to(destination: WritableTyped<T>): Promise<void>;
|
|
116
|
-
forEach(fn:
|
|
117
|
-
forEachSync(fn:
|
|
116
|
+
forEach(fn: AbortableAsyncMapper<T, void>, opt?: TransformMapOptions<T, void> & TransformLogProgressOptions<T>): Promise<void>;
|
|
117
|
+
forEachSync(fn: AbortableMapper<T, void>, opt?: TransformMapSyncOptions<T, void> & TransformLogProgressOptions<T>): Promise<void>;
|
|
118
118
|
run(): Promise<void>;
|
|
119
119
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@naturalcycles/nodejs-lib",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "15.
|
|
4
|
+
"version": "15.112.0",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@naturalcycles/js-lib": "^15",
|
|
7
7
|
"@standard-schema/spec": "^1",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
20
|
"@typescript/native-preview": "beta",
|
|
21
|
-
"@naturalcycles/dev-lib": "
|
|
21
|
+
"@naturalcycles/dev-lib": "18.4.2"
|
|
22
22
|
},
|
|
23
23
|
"exports": {
|
|
24
24
|
".": "./dist/index.js",
|
package/src/stream/pipeline.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { createAbortableSignal } from '@naturalcycles/js-lib'
|
|
|
8
8
|
import { _passthroughPredicate } from '@naturalcycles/js-lib/types'
|
|
9
9
|
import type {
|
|
10
10
|
AbortableAsyncMapper,
|
|
11
|
+
AbortableMapper,
|
|
11
12
|
AsyncIndexedMapper,
|
|
12
13
|
AsyncPredicate,
|
|
13
14
|
END,
|
|
@@ -236,12 +237,12 @@ export class Pipeline<T = unknown> {
|
|
|
236
237
|
return this
|
|
237
238
|
}
|
|
238
239
|
|
|
239
|
-
tap(fn: AsyncIndexedMapper<T,
|
|
240
|
+
tap(fn: AsyncIndexedMapper<T, void>, opt?: TransformOptions): this {
|
|
240
241
|
this.transforms.push(transformTap(fn, opt))
|
|
241
242
|
return this
|
|
242
243
|
}
|
|
243
244
|
|
|
244
|
-
tapSync(fn: IndexedMapper<T,
|
|
245
|
+
tapSync(fn: IndexedMapper<T, void>, opt?: TransformOptions): this {
|
|
245
246
|
this.transforms.push(transformTapSync(fn, opt))
|
|
246
247
|
return this
|
|
247
248
|
}
|
|
@@ -420,7 +421,7 @@ export class Pipeline<T = unknown> {
|
|
|
420
421
|
}
|
|
421
422
|
|
|
422
423
|
async forEach(
|
|
423
|
-
fn:
|
|
424
|
+
fn: AbortableAsyncMapper<T, void>,
|
|
424
425
|
opt: TransformMapOptions<T, void> & TransformLogProgressOptions<T> = {},
|
|
425
426
|
): Promise<void> {
|
|
426
427
|
this.transforms.push(
|
|
@@ -437,7 +438,7 @@ export class Pipeline<T = unknown> {
|
|
|
437
438
|
}
|
|
438
439
|
|
|
439
440
|
async forEachSync(
|
|
440
|
-
fn:
|
|
441
|
+
fn: AbortableMapper<T, void>,
|
|
441
442
|
opt: TransformMapSyncOptions<T, void> & TransformLogProgressOptions<T> = {},
|
|
442
443
|
): Promise<void> {
|
|
443
444
|
this.transforms.push(
|