[Pkg-javascript-commits] [node-stream-splicer] 67/71: Remove old compat deps "isarray" and "indexof"

Bastien Roucariès rouca at moszumanska.debian.org
Fri Dec 15 09:55:53 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 97c05501b73e1aa66ed2f00b40dfdfe32dba6272
Author: Andres Suarez <zertosh at gmail.com>
Date:   Sun Aug 23 19:15:09 2015 -0400

    Remove old compat deps "isarray" and "indexof"
---
 index.js     | 14 ++++++--------
 package.json |  4 +---
 2 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/index.js b/index.js
index 40e0ed5..d944fa4 100644
--- a/index.js
+++ b/index.js
@@ -1,8 +1,6 @@
 var Duplex = require('readable-stream').Duplex;
 var PassThrough = require('readable-stream').PassThrough;
 var inherits = require('inherits');
-var isArray = require('isarray');
-var indexof = require('indexof');
 var wrap = require('readable-wrap');
 
 var nextTick = typeof setImmediate !== 'undefined'
@@ -13,7 +11,7 @@ module.exports = Pipeline;
 inherits(Pipeline, Duplex);
 
 module.exports.obj = function (streams, opts) {
-    if (!opts && !isArray(streams)) {
+    if (!opts && !Array.isArray(streams)) {
         opts = streams;
         streams = [];
     }
@@ -25,7 +23,7 @@ module.exports.obj = function (streams, opts) {
 
 function Pipeline (streams, opts) {
     if (!(this instanceof Pipeline)) return new Pipeline(streams, opts);
-    if (!opts && !isArray(streams)) {
+    if (!opts && !Array.isArray(streams)) {
         opts = streams;
         streams = [];
     }
@@ -77,7 +75,7 @@ Pipeline.prototype._notEmpty = function () {
     if (this._streams.length > 0) return;
     var stream = new PassThrough(this._options);
     stream.once('end', function () {
-        var ix = indexof(self._streams, stream);
+        var ix = self._streams.indexOf(stream);
         if (ix >= 0 && ix === self._streams.length - 1) {
             Duplex.prototype.push.call(self, null);
         }
@@ -124,7 +122,7 @@ Pipeline.prototype.splice = function (start, removeLen) {
     
     var reps = [], args = arguments;
     for (var j = 2; j < args.length; j++) (function (stream) {
-        if (isArray(stream)) {
+        if (Array.isArray(stream)) {
             stream = new Pipeline(stream, self._options);
         }
         stream.on('error', function (err) {
@@ -133,7 +131,7 @@ Pipeline.prototype.splice = function (start, removeLen) {
         });
         stream = self._wrapStream(stream);
         stream.once('end', function () {
-            var ix = indexof(self._streams, stream);
+            var ix = self._streams.indexOf(stream);
             if (ix >= 0 && ix === self._streams.length - 1) {
                 Duplex.prototype.push.call(self, null);
             }
@@ -178,7 +176,7 @@ Pipeline.prototype.get = function () {
 };
 
 Pipeline.prototype.indexOf = function (stream) {
-    return indexof(this._streams, stream);
+    return this._streams.indexOf(stream);
 };
 
 Pipeline.prototype._wrapStream = function (stream) {
diff --git a/package.json b/package.json
index 97bc489..59a2877 100644
--- a/package.json
+++ b/package.json
@@ -5,11 +5,9 @@
   "main": "index.js",
   "dependencies": {
     "inherits": "^2.0.1",
-    "isarray": "~0.0.1",
     "readable-stream": "^1.1.13-1",
     "readable-wrap": "^1.0.0",
-    "through2": "^1.0.0",
-    "indexof": "0.0.1"
+    "through2": "^1.0.0"
   },
   "devDependencies": {
     "tape": "^2.12.1",

-- 
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