@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
|
-
|
|
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<
|
|
2
|
+
export declare function next<T>(dep: DependencyStream<T>): Promise<T>;
|
package/package.json
CHANGED