From 8a12e9cf94c5709b7c648f194c859c0b7d0c22c3 Mon Sep 17 00:00:00 2001 From: Juan Cruz Viotti Date: Fri, 31 Mar 2017 10:53:23 -0400 Subject: [PATCH] refactor(image-stream): get rid of `isstream` (#1244) The dependency is not yet removed from `npm-shrinkwrap.json` given that there another one that keeps requiring it. Signed-off-by: Juan Cruz Viotti --- lib/image-stream/index.js | 6 ++++-- package.json | 1 - 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/image-stream/index.js b/lib/image-stream/index.js index 96376737..d7b84b0a 100644 --- a/lib/image-stream/index.js +++ b/lib/image-stream/index.js @@ -19,7 +19,7 @@ const _ = require('lodash'); const Bluebird = require('bluebird'); const fs = Bluebird.promisifyAll(require('fs')); -const isStream = require('isstream'); +const stream = require('stream'); const utils = require('./utils'); const handlers = require('./handlers'); const supportedFileTypes = require('./supported'); @@ -119,7 +119,9 @@ exports.getImageMetadata = (file) => { // destroy() it, to avoid dangling open file descriptors etc. image.stream.destroy(); - return _.omitBy(image, isStream); + return _.omitBy(image, (property) => { + return property instanceof stream.Stream; + }); }); }; diff --git a/package.json b/package.json index c07b8164..f50411b2 100644 --- a/package.json +++ b/package.json @@ -86,7 +86,6 @@ "gzip-uncompressed-size": "^1.0.0", "immutable": "^3.8.1", "is-elevated": "^2.0.1", - "isstream": "^0.1.2", "lodash": "^4.5.1", "lodash-deep": "^2.0.0", "lzma-native": "^1.5.2",