Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/webtorrent/webtorrent.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFeross Aboukhadijeh <feross@feross.org>2019-08-09 23:44:15 +0300
committerGitHub <noreply@github.com>2019-08-09 23:44:15 +0300
commit30dd8dc201775610cfebfb974e27d990073c178e (patch)
treecc7cf3ac4dd1eacfdd773707101768c6bbfb63d1
parent6349dabc231b5c182453ab1a40d03a179555402a (diff)
parente583bd785447c2e811811414083b8ca0683dc343 (diff)
Merge pull request #1692 from webtorrent/greenkeeper/stream-to-blob-url-3.0.0
Update stream-to-blob-url to the latest version 🚀
-rw-r--r--lib/file.js11
-rw-r--r--package.json2
2 files changed, 10 insertions, 3 deletions
diff --git a/lib/file.js b/lib/file.js
index 993e06a..381ae5c 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) {
diff --git a/package.json b/package.json
index f3cbbce..97c88f1 100644
--- a/package.json
+++ b/package.json
@@ -66,7 +66,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",