@thi.ng/rstream 9.2.3 → 9.2.4

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/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Change Log
2
2
 
3
- - **Last updated**: 2025-01-04T21:07:38Z
3
+ - **Last updated**: 2025-01-14T12:23:33Z
4
4
  - **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
5
5
 
6
6
  All notable changes to this project will be documented in this file.
@@ -9,6 +9,12 @@ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelin
9
9
  **Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
10
10
  and/or version bumps of transitive dependencies.
11
11
 
12
+ ### [9.2.4](https://github.com/thi-ng/umbrella/tree/@thi.ng/rstream@9.2.4) (2025-01-14)
13
+
14
+ #### ♻️ Refactoring
15
+
16
+ - use optional chaining & nullish coalescing ([c5a0a13](https://github.com/thi-ng/umbrella/commit/c5a0a13))
17
+
12
18
  ## [9.2.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/rstream@9.2.0) (2024-12-05)
13
19
 
14
20
  #### 🚀 Features
package/README.md CHANGED
@@ -215,7 +215,7 @@ For Node.js REPL:
215
215
  const rs = await import("@thi.ng/rstream");
216
216
  ```
217
217
 
218
- Package sizes (brotli'd, pre-treeshake): ESM: 6.34 KB
218
+ Package sizes (brotli'd, pre-treeshake): ESM: 6.33 KB
219
219
 
220
220
  ## Dependencies
221
221
 
package/nodejs.js CHANGED
@@ -3,7 +3,7 @@ import { stream } from "./stream.js";
3
3
  const fromNodeJS = (stdout, stderr, close = true) => {
4
4
  const ingest = stream();
5
5
  stdout.on("data", (data) => ingest.next(data));
6
- stderr && stderr.on("data", (data) => ingest.error(data));
6
+ stderr?.on("data", (data) => ingest.error(data));
7
7
  close && stdout.on("close", () => ingest.done());
8
8
  return ingest;
9
9
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/rstream",
3
- "version": "9.2.3",
3
+ "version": "9.2.4",
4
4
  "description": "Reactive streams & subscription primitives for constructing dataflow graphs / pipelines",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -45,13 +45,13 @@
45
45
  },
46
46
  "dependencies": {
47
47
  "@thi.ng/api": "^8.11.16",
48
- "@thi.ng/arrays": "^2.10.9",
49
- "@thi.ng/associative": "^7.0.18",
50
- "@thi.ng/atom": "^5.3.16",
51
- "@thi.ng/checks": "^3.6.18",
48
+ "@thi.ng/arrays": "^2.10.10",
49
+ "@thi.ng/associative": "^7.0.19",
50
+ "@thi.ng/atom": "^5.3.17",
51
+ "@thi.ng/checks": "^3.6.19",
52
52
  "@thi.ng/errors": "^2.5.22",
53
- "@thi.ng/logger": "^3.0.26",
54
- "@thi.ng/transducers": "^9.2.12"
53
+ "@thi.ng/logger": "^3.0.27",
54
+ "@thi.ng/transducers": "^9.2.13"
55
55
  },
56
56
  "devDependencies": {
57
57
  "@microsoft/api-extractor": "^7.48.1",
@@ -223,5 +223,5 @@
223
223
  ],
224
224
  "year": 2017
225
225
  },
226
- "gitHead": "56c1d57a96565bbcc8c06c73779a619bba0db368\n"
226
+ "gitHead": "6542b842120bef47cc18d45a1b1db68307a7f04b\n"
227
227
  }
package/pubsub.js CHANGED
@@ -80,7 +80,7 @@ class PubSub extends Subscription {
80
80
  const sub = this.topics.get(t);
81
81
  if (sub) {
82
82
  try {
83
- sub.next && sub.next(x);
83
+ sub.next?.(x);
84
84
  } catch (e) {
85
85
  if (!sub.error || !sub.error(e)) {
86
86
  return this.unhandledError(e);
package/subscription.js CHANGED
@@ -102,7 +102,7 @@ class Subscription {
102
102
  }
103
103
  unsubscribeSelf() {
104
104
  LOGGER.debug(this.id, "unsub self");
105
- this.parent && this.parent.unsubscribe(this);
105
+ this.parent?.unsubscribe(this);
106
106
  this.state < State.UNSUBSCRIBED && (this.state = State.UNSUBSCRIBED);
107
107
  this.release();
108
108
  return true;
@@ -137,9 +137,9 @@ class Subscription {
137
137
  }
138
138
  error(e) {
139
139
  const sub = this.wrapped;
140
- const hasErrorHandler = sub && sub.error;
141
- hasErrorHandler && LOGGER.debug(this.id, "attempting wrapped error handler");
142
- return hasErrorHandler && sub.error(e) || this.unhandledError(e);
140
+ const errorHandler = sub?.error;
141
+ errorHandler && LOGGER.debug(this.id, "attempting wrapped error handler");
142
+ return errorHandler?.(e) || this.unhandledError(e);
143
143
  }
144
144
  unhandledError(e) {
145
145
  (LOGGER.parent !== NULL_LOGGER ? LOGGER : console).warn(
package/tunnel.js CHANGED
@@ -51,7 +51,7 @@ class Tunnel extends Subscription {
51
51
  if (this.terminate > 0) {
52
52
  setTimeout(() => {
53
53
  LOGGER.info("terminating workers...");
54
- this.workers.forEach((worker) => worker && worker.terminate());
54
+ this.workers.forEach((worker) => worker?.terminate());
55
55
  delete this.workers;
56
56
  }, this.terminate);
57
57
  }