diff options
author | Feross Aboukhadijeh <feross@feross.org> | 2019-08-02 02:48:29 +0300 |
---|---|---|
committer | Feross Aboukhadijeh <feross@feross.org> | 2019-08-02 02:48:29 +0300 |
commit | 17443b6cc69b04ec51c01947dd4a5622279b4527 (patch) | |
tree | dd31a0c0011fe008950d60ef44047c4d4b79699d | |
parent | 3ee9ed2c9d039f9d25d904a5a84d6cc68c502ae8 (diff) |
stream-to-blob@2
For https://github.com/brave/brave-browser/issues/5490
-rw-r--r-- | lib/file.js | 3 | ||||
-rw-r--r-- | package.json | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/file.js b/lib/file.js index 8bcfe22..993e06a 100644 --- a/lib/file.js +++ b/lib/file.js @@ -104,7 +104,8 @@ class File extends EventEmitter { getBlob (cb) { if (typeof window === 'undefined') throw new Error('browser-only method') - streamToBlob(this.createReadStream(), this._getMimeType(), cb) + streamToBlob(this.createReadStream(), this._getMimeType()) + .then(blob => cb(null, blob), cb) } getBlobURL (cb) { diff --git a/package.json b/package.json index ccf4905..b9515e3 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,7 @@ "simple-peer": "^9.0.0", "simple-sha1": "^2.0.8", "speedometer": "^1.0.0", - "stream-to-blob": "^1.0.0", + "stream-to-blob": "^2.0.0", "stream-to-blob-url": "^2.1.0", "stream-with-known-length-to-buffer": "^1.0.0", "torrent-discovery": "^9.1.1", |