[Pkg-javascript-commits] [node-stream-splicer] 69/71: Use streams3

Bastien Roucariès rouca at moszumanska.debian.org
Fri Dec 15 09:55:54 UTC 2017


This is an automated email from the git hooks/post-receive script.

rouca pushed a commit to branch master
in repository node-stream-splicer.

commit d385c3a601dc1a81d47e7b5e62c5845d169cc2f3
Author: Andres Suarez <zertosh at gmail.com>
Date:   Sun Aug 23 19:20:18 2015 -0400

    Use streams3
    
    * Update to readable-stream@^2.0.2
    * Remove "readable-wrap" since it isn't needed anymore because the [issue] [1] it aimed to fix is now part of [streams3] [2].
    * Move "through2" to devDeps
    * Update devDeps
    
    [1]: https://github.com/joyent/node/pull/7758
    [2]: https://github.com/nodejs/readable-stream/blob/v2.0.2/lib/_stream_readable.js#L812-L816
---
 index.js     |  8 ++++++--
 package.json | 11 +++++------
 2 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/index.js b/index.js
index d944fa4..ce386c8 100644
--- a/index.js
+++ b/index.js
@@ -1,7 +1,7 @@
 var Duplex = require('readable-stream').Duplex;
 var PassThrough = require('readable-stream').PassThrough;
+var Readable = require('readable-stream').Readable;
 var inherits = require('inherits');
-var wrap = require('readable-wrap');
 
 var nextTick = typeof setImmediate !== 'undefined'
     ? setImmediate : process.nextTick
@@ -153,6 +153,10 @@ Pipeline.prototype.splice = function (start, removeLen) {
     var sargs = [start,removeLen].concat(reps);
     var removed = self._streams.splice.apply(self._streams, sargs);
     
+    for (var i = 0; i < reps.length; i++) {
+        reps[i].read(0);
+    }
+    
     this.emit('_mutate');
     this.length = this._streams.length;
     return removed;
@@ -181,7 +185,7 @@ Pipeline.prototype.indexOf = function (stream) {
 
 Pipeline.prototype._wrapStream = function (stream) {
     if (typeof stream.read === 'function') return stream;
-    var w = wrap(stream, this._wrapOptions);
+    var w = new Readable(this._wrapOptions).wrap(stream);
     w._write = function (buf, enc, next) {
         if (stream.write(buf) === false) {
             stream.once('drain', next);
diff --git a/package.json b/package.json
index 71c43fe..c306dd5 100644
--- a/package.json
+++ b/package.json
@@ -5,15 +5,14 @@
   "main": "index.js",
   "dependencies": {
     "inherits": "^2.0.1",
-    "readable-stream": "^1.1.13-1",
-    "readable-wrap": "^1.0.0",
-    "through2": "^1.0.0"
+    "readable-stream": "^2.0.2"
   },
   "devDependencies": {
-    "tape": "^2.12.1",
-    "JSONStream": "~0.8.2",
+    "JSONStream": "^1.0.4",
     "concat-stream": "^1.4.6",
-    "split": "~0.3.0"
+    "split": "^1.0.0",
+    "tape": "^4.2.0",
+    "through2": "^2.0.0"
   },
   "scripts": {
     "test": "tape test/*.js"

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-stream-splicer.git



More information about the Pkg-javascript-commits mailing list