@thi.ng/rstream 9.5.0 → 9.5.2
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/nodejs.d.ts +3 -3
- package/package.json +2 -2
- package/subscription.js +3 -5
- package/transduce.d.ts +2 -2
package/nodejs.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import type { Readable } from "node:stream";
|
|
2
|
-
import type { ISubscription } from "./api.js";
|
|
2
|
+
import type { ISubscriber, ISubscription } from "./api.js";
|
|
3
3
|
/**
|
|
4
4
|
* Adapter bridge from NodeJS streams. Pipes data from given `stdout` (assumed
|
|
5
5
|
* to produce data of type `T`) into `ingest` or creates and returns a new
|
|
6
6
|
* {@link stream}. If given, also connects given `stderr` to `ingest`'s error
|
|
7
|
-
* handler. Unless `close` is false, `ingest` closes once `stdout` is closed.
|
|
7
|
+
* handler (if defined). Unless `close` is false, `ingest` closes once `stdout` is closed.
|
|
8
8
|
*
|
|
9
9
|
* @param stdout -
|
|
10
10
|
* @param stderr -
|
|
11
11
|
* @param close -
|
|
12
12
|
* @param ingest -
|
|
13
13
|
*/
|
|
14
|
-
export declare const fromNodeJS: <T>(stdout: Readable, stderr?: Readable, close?: boolean, ingest?:
|
|
14
|
+
export declare const fromNodeJS: <T>(stdout: Readable, stderr?: Readable, close?: boolean, ingest?: ISubscriber<T>) => ISubscriber<T>;
|
|
15
15
|
/**
|
|
16
16
|
* Specialized version of {@link fromNodeJS} for string inputs and automatic
|
|
17
17
|
* rechunking/splitting of the input using the optionally provided regexp (line
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/rstream",
|
|
3
|
-
"version": "9.5.
|
|
3
|
+
"version": "9.5.2",
|
|
4
4
|
"description": "Reactive streams & subscription primitives for constructing dataflow graphs / pipelines",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -223,5 +223,5 @@
|
|
|
223
223
|
],
|
|
224
224
|
"year": 2017
|
|
225
225
|
},
|
|
226
|
-
"gitHead": "
|
|
226
|
+
"gitHead": "2085e9600e121134429c85f6d0ead46e3ce920ca"
|
|
227
227
|
}
|
package/subscription.js
CHANGED
|
@@ -4,6 +4,7 @@ import { isPlainObject } from "@thi.ng/checks/is-plain-object";
|
|
|
4
4
|
import { assert } from "@thi.ng/errors/assert";
|
|
5
5
|
import { illegalState } from "@thi.ng/errors/illegal-state";
|
|
6
6
|
import { NULL_LOGGER } from "@thi.ng/logger/null";
|
|
7
|
+
import { ROOT } from "@thi.ng/logger/root";
|
|
7
8
|
import { comp } from "@thi.ng/transducers/comp";
|
|
8
9
|
import { map } from "@thi.ng/transducers/map";
|
|
9
10
|
import { push } from "@thi.ng/transducers/push";
|
|
@@ -143,11 +144,8 @@ class Subscription {
|
|
|
143
144
|
return errorHandler?.(e) || this.unhandledError(e);
|
|
144
145
|
}
|
|
145
146
|
unhandledError(e) {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
"unhandled error:",
|
|
149
|
-
e
|
|
150
|
-
);
|
|
147
|
+
const isNullLogger = LOGGER.parent === NULL_LOGGER || LOGGER.parent === ROOT && ROOT.parent === NULL_LOGGER;
|
|
148
|
+
(isNullLogger ? console : LOGGER).warn(this.id, "unhandled error:", e);
|
|
151
149
|
this.unsubscribe();
|
|
152
150
|
this.state = State.ERROR;
|
|
153
151
|
return false;
|
package/transduce.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Reducer, Transducer } from "@thi.ng/transducers";
|
|
2
|
-
import type {
|
|
2
|
+
import type { ISubscribable } from "./api.js";
|
|
3
3
|
/**
|
|
4
4
|
* Returns a promise which subscribes to given input and transforms
|
|
5
5
|
* incoming values using given transducer `xform` and reducer `rfn`.
|
|
@@ -27,5 +27,5 @@ import type { Subscription } from "./subscription.js";
|
|
|
27
27
|
* @param rfn -
|
|
28
28
|
* @param init -
|
|
29
29
|
*/
|
|
30
|
-
export declare const transduce: <A, B, C>(src:
|
|
30
|
+
export declare const transduce: <A, B, C>(src: ISubscribable<A>, xform: Transducer<A, B>, rfn: Reducer<B, C>, init?: C) => Promise<C>;
|
|
31
31
|
//# sourceMappingURL=transduce.d.ts.map
|