Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update stream-to-blob-url to the latest version 🚀 #1692

Merged
merged 2 commits into from Aug 9, 2019
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

Prev

Fixes for stream-to-blob-url@3

  • Loading branch information
feross committed Aug 9, 2019
commit e583bd785447c2e811811414083b8ca0683dc343
@@ -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) {
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.