Browse Source

Add peek method

Sven Slootweg 1 year ago
parent
commit
9f11eb44fc
2 changed files with 3 additions and 0 deletions
  1. 2 0
      index.js
  2. 1 0
      package.json

+ 2 - 0
index.js

@ -2,12 +2,14 @@
2 2
3 3
const Promise = require("bluebird");
4 4
const propagateAbort = require("@ppstreams/propagate-abort");
5
const propagatePeek = require("@ppstreams/propagate-peek");
5 6
const { isEndOfStream } = require("@ppstreams/end-of-stream-marker");
6 7
7 8
module.exports = function greedySinkStream(description, callback) {
8 9
	return {
9 10
		description: `greedy sink stream (${description})`,
10 11
		abort: propagateAbort,
12
		peek: propagatePeek,
11 13
		read: function produceValue_greedySinkStream(source) {
12 14
			let lastResult;
13 15

+ 1 - 0
package.json

@ -7,6 +7,7 @@
7 7
  "license": "WTFPL OR CC0-1.0",
8 8
  "dependencies": {
9 9
    "@ppstreams/propagate-abort": "^0.1.2",
10
    "@ppstreams/propagate-peek": "^0.1.0",
10 11
    "bluebird": "^3.5.4"
11 12
  }
12 13
}