@graffy/stream 0.16.14 → 0.16.15-alpha.2

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.
Files changed (3) hide show
  1. package/index.cjs +6 -1
  2. package/index.mjs +6 -1
  3. package/package.json +1 -1
package/index.cjs CHANGED
@@ -6,7 +6,11 @@ function makeStream(init, options = {}) {
6
6
  const requests = [];
7
7
  let complete;
8
8
  let drain;
9
- const { highWatermark = Infinity, lowWatermark = 0, debugId } = options;
9
+ const {
10
+ highWatermark = Number.POSITIVE_INFINITY,
11
+ lowWatermark = 0,
12
+ debugId
13
+ } = options;
10
14
  const push = (value) => {
11
15
  if (complete)
12
16
  return;
@@ -52,6 +56,7 @@ function makeStream(init, options = {}) {
52
56
  close(null, value);
53
57
  return complete;
54
58
  },
59
+ /** @return {Promise<{ value: any, done: boolean }>} */
55
60
  throw(error) {
56
61
  complete = Promise.reject(error);
57
62
  payloads.length = 0;
package/index.mjs CHANGED
@@ -4,7 +4,11 @@ function makeStream(init, options = {}) {
4
4
  const requests = [];
5
5
  let complete;
6
6
  let drain;
7
- const { highWatermark = Infinity, lowWatermark = 0, debugId } = options;
7
+ const {
8
+ highWatermark = Number.POSITIVE_INFINITY,
9
+ lowWatermark = 0,
10
+ debugId
11
+ } = options;
8
12
  const push = (value) => {
9
13
  if (complete)
10
14
  return;
@@ -50,6 +54,7 @@ function makeStream(init, options = {}) {
50
54
  close(null, value);
51
55
  return complete;
52
56
  },
57
+ /** @return {Promise<{ value: any, done: boolean }>} */
53
58
  throw(error) {
54
59
  complete = Promise.reject(error);
55
60
  payloads.length = 0;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graffy/stream",
3
3
  "description": "Utility for creating AsyncIterables (streams) from any callback-based",
4
4
  "author": "aravind (https://github.com/aravindet)",
5
- "version": "0.16.14",
5
+ "version": "0.16.15-alpha.2",
6
6
  "main": "./index.cjs",
7
7
  "exports": {
8
8
  "import": "./index.mjs",