@fbltd/async 1.0.12 → 1.0.13

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,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InternalStreamFinishError = void 0;
3
4
  exports.next = next;
4
5
  const constants_1 = require("../../constants");
6
+ const StreamFinishError = new Error("Stream is done");
5
7
  async function next(dep) {
6
- return (await dep[constants_1.symAI]().next()).value;
8
+ const res = await dep[constants_1.symAI]().next();
9
+ if (res.done) {
10
+ throw StreamFinishError;
11
+ }
12
+ return res.value;
7
13
  }
14
+ /**
15
+ * @internal
16
+ */
17
+ exports.InternalStreamFinishError = StreamFinishError;
@@ -1,2 +1,2 @@
1
1
  import { DependencyStream } from "../dependency-stream";
2
- export declare function next<T>(dep: DependencyStream<T>): Promise<void | T>;
2
+ export declare function next<T>(dep: DependencyStream<T>): Promise<T>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fbltd/async",
3
- "version": "1.0.12",
3
+ "version": "1.0.13",
4
4
  "description": "Miscellaneous async utils",
5
5
  "homepage": "https://github.com/GlennMiller1991/async",
6
6
  "keywords": [
package/tsconfig.json CHANGED
@@ -4,6 +4,7 @@
4
4
  "compilerOptions": {
5
5
  "module": "CommonJS",
6
6
  "moduleResolution": "node",
7
+ "stripInternal": true,
7
8
  },
8
9
  }
9
10
  // @formatter:on