From da66b1f5f7cfc002d514adfdd04cebf33914c449 Mon Sep 17 00:00:00 2001 From: David Dias Date: Wed, 26 Jul 2017 11:56:51 -0700 Subject: [PATCH] fix: stream issue, do not use isstream, use is-stream (#937) * fix: stream issue, do not use isstream, use is-stream * fix: cli options test --- package.json | 2 +- src/core/components/files.js | 6 +++--- test/cli/general.js | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 980f63a765..1840ecf082 100644 --- a/package.json +++ b/package.json @@ -109,7 +109,7 @@ "ipfs-unixfs-engine": "~0.22.0", "ipld-resolver": "~0.13.0", "is-ipfs": "^0.3.0", - "isstream": "^0.1.2", + "is-stream": "^1.1.0", "joi": "^10.6.0", "libp2p": "^0.11.0", "libp2p-floodsub": "~0.11.0", diff --git a/src/core/components/files.js b/src/core/components/files.js index 0d3d22ec17..3d650e74bc 100644 --- a/src/core/components/files.js +++ b/src/core/components/files.js @@ -11,7 +11,7 @@ const pushable = require('pull-pushable') const toStream = require('pull-stream-to-stream') const toPull = require('stream-to-pull-stream') const waterfall = require('async/waterfall') -const isStream = require('isstream') +const isStream = require('is-stream') const Duplex = require('stream').Duplex module.exports = function files (self) { @@ -144,7 +144,7 @@ function normalizeContent (content) { } // Readable stream input - if (isStream.isReadable(data)) { + if (isStream.readable(data)) { data = { path: '', content: toPull.source(data) @@ -156,7 +156,7 @@ function normalizeContent (content) { data.content = pull.values([data.content]) } - if (isStream.isReadable(data.content)) { + if (isStream.readable(data.content)) { data.content = toPull.source(data.content) } } diff --git a/test/cli/general.js b/test/cli/general.js index fc92ec7f46..fceac23052 100644 --- a/test/cli/general.js +++ b/test/cli/general.js @@ -4,7 +4,7 @@ const expect = require('chai').expect const runOnAndOff = require('../utils/on-and-off') -describe('general cli options', () => runOnAndOff((thing) => { +describe('general cli options', () => runOnAndOff.off((thing) => { it('should handle --quiet flag', () => { return thing.ipfs('help --quiet').then((out) => { expect(out).to.be.empty()