@thi.ng/rstream 9.3.19 → 9.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 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.37 KB
218
+ Package sizes (brotli'd, pre-treeshake): ESM: 6.39 KB
219
219
 
220
220
  ## Dependencies
221
221
 
package/checks.d.ts CHANGED
@@ -1,5 +1,7 @@
1
- import type { CloseMode, ISubscribable } from "./api.js";
1
+ import type { CloseMode, ISubscribable, ISubscriber, ISubscription } from "./api.js";
2
+ export declare const isSubscriber: (x: any) => x is ISubscriber<any>;
2
3
  export declare const isSubscribable: (x: any) => x is ISubscribable<any>;
4
+ export declare const isSubscriptionLike: (x: any) => x is ISubscription<any, any>;
3
5
  /**
4
6
  * Returns true if mode is FIRST, or if mode is LAST *and* `num = 0`.
5
7
  *
package/checks.js CHANGED
@@ -1,7 +1,11 @@
1
1
  import { implementsFunction } from "@thi.ng/checks/implements-function";
2
+ const isSubscriber = (x) => implementsFunction(x, "next");
2
3
  const isSubscribable = (x) => implementsFunction(x, "subscribe");
4
+ const isSubscriptionLike = (x) => isSubscriber(x) && isSubscribable(x);
3
5
  const isFirstOrLastInput = (mode, num) => mode === "first" || mode === "last" && !num;
4
6
  export {
5
7
  isFirstOrLastInput,
6
- isSubscribable
8
+ isSubscribable,
9
+ isSubscriber,
10
+ isSubscriptionLike
7
11
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/rstream",
3
- "version": "9.3.19",
3
+ "version": "9.4.0",
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": "82ec7cc54d0e89dad89cde87fa36c444512d71d7\n"
226
+ "gitHead": "18e5911e6d52c86190706438b753de415379d3fa\n"
227
227
  }