diff --git a/index.js b/index.js index 3a7cf08..97292fa 100644 --- a/index.js +++ b/index.js @@ -4,7 +4,7 @@ var cloneStats = require('clone-stats'); var cloneBuffer = require('./lib/cloneBuffer'); var removeTrailingSep = require('remove-trailing-separator'); var isBuffer = require('./lib/isBuffer'); -var isStream = require('./lib/isStream'); +var isStream = require('is-stream'); var isNull = require('./lib/isNull'); var inspectStream = require('./lib/inspectStream'); var normalize = require('./lib/normalize'); diff --git a/lib/inspectStream.js b/lib/inspectStream.js index 942f23d..b9affed 100644 --- a/lib/inspectStream.js +++ b/lib/inspectStream.js @@ -1,4 +1,4 @@ -var isStream = require('./isStream'); +var isStream = require('is-stream'); module.exports = function(stream) { if (!isStream(stream)) { diff --git a/lib/isStream.js b/lib/isStream.js deleted file mode 100644 index d2e8ac4..0000000 --- a/lib/isStream.js +++ /dev/null @@ -1,5 +0,0 @@ -var Stream = require('readable-stream').Stream; - -module.exports = function(o) { - return !!o && o instanceof Stream; -}; diff --git a/package.json b/package.json index 76e4304..061d68e 100644 --- a/package.json +++ b/package.json @@ -14,8 +14,8 @@ "clone": "^1.0.0", "clone-stats": "^1.0.0", "cloneable-readable": "^0.5.0", - "readable-stream": "^2.1.0", "remove-trailing-separator": "^1.0.1", + "is-stream": "^1.1.0", "replace-ext": "^1.0.0" }, "devDependencies": { @@ -28,7 +28,8 @@ "jscs": "^2.3.5", "jscs-preset-gulp": "^1.0.0", "mississippi": "^1.2.0", - "mocha": "^2.4.5" + "mocha": "^2.4.5", + "readable-stream": "^2.1.0" }, "scripts": { "lint": "eslint . && jscs index.js lib/ test/", diff --git a/test/is-stream.js b/test/is-stream.js deleted file mode 100644 index 13bea85..0000000 --- a/test/is-stream.js +++ /dev/null @@ -1,37 +0,0 @@ -'use strict'; - -var expect = require('expect'); -// Use node stream to test readable-stream inherits from it -var Stream = require('stream'); - -var isStream = require('../lib/isStream'); - -describe('isStream()', function() { - - it('returns true for a Stream', function(done) { - var testStream = new Stream(); - var result = isStream(testStream); - expect(result).toEqual(true); - done(); - }); - - it('returns false for a Buffer', function(done) { - var testBuffer = new Buffer('test'); - var result = isStream(testBuffer); - expect(result).toEqual(false); - done(); - }); - - it('returns false for null', function(done) { - var result = isStream(null); - expect(result).toEqual(false); - done(); - }); - - it('returns false for an array of numbers', function(done) { - var testArray = [1, 2, 3]; - var result = isStream(testArray); - expect(result).toEqual(false); - done(); - }); -});