From 459267e1cabfbe257a78f2693af9dcb537745833 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" <23040076+greenkeeper[bot]@users.noreply.github.com> Date: Thu, 8 Aug 2019 04:36:49 +0000 Subject: [PATCH 1/2] fix(package): update stream-to-blob-url to version 3.0.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7dbab051..d97f2999 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,7 @@ "simple-sha1": "^2.0.8", "speedometer": "^1.0.0", "stream-to-blob": "^2.0.0", - "stream-to-blob-url": "^2.1.0", + "stream-to-blob-url": "^3.0.0", "stream-with-known-length-to-buffer": "^1.0.0", "torrent-discovery": "^9.1.1", "torrent-piece": "^2.0.0", From e583bd785447c2e811811414083b8ca0683dc343 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Fri, 9 Aug 2019 13:40:41 -0700 Subject: [PATCH 2/2] Fixes for stream-to-blob-url@3 --- lib/file.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/file.js b/lib/file.js index 993e06af..381ae5c5 100644 --- a/lib/file.js +++ b/lib/file.js @@ -105,12 +105,19 @@ class File extends EventEmitter { getBlob (cb) { if (typeof window === 'undefined') throw new Error('browser-only method') streamToBlob(this.createReadStream(), this._getMimeType()) - .then(blob => cb(null, blob), cb) + .then( + blob => cb(null, blob), + err => cb(err) + ) } getBlobURL (cb) { if (typeof window === 'undefined') throw new Error('browser-only method') - streamToBlobURL(this.createReadStream(), this._getMimeType(), cb) + streamToBlobURL(this.createReadStream(), this._getMimeType()) + .then( + blobUrl => cb(null, blobUrl), + err => cb(err) + ) } appendTo (elem, opts, cb) {