From 82e6669462fdc4c1a99fb571c1421984e6fa0729 Mon Sep 17 00:00:00 2001 From: Avril Date: Tue, 28 Jul 2020 20:57:02 +0100 Subject: [PATCH] uh --- stage.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/stage.js b/stage.js index 2df2ebe..a8bf09f 100644 --- a/stage.js +++ b/stage.js @@ -1,4 +1,3 @@ - /** * An async collection / item stream. * @param {Array} from Optional array to begin reading from. @@ -25,6 +24,12 @@ function Stage(from) { } }; + /** + * Returns true if there are any values left in the stream, or if the stream is still open. + */ + this.hasValues = () => { + return !(base.over && base.array.length==0); + }; /** * Take one item off then end. Function will yield if none available to produce yet. * @return {} undefined if there is no more items to produce (`commit` was called), otherwise the next item in the stream.