blob-to-buffer
Advanced tools
Comparing version 1.2.2 to 1.2.3
20
index.js
@@ -16,20 +16,10 @@ /* global Blob, FileReader */ | ||
function onLoad (e) { | ||
unregisterEvents() | ||
cb(null, toBuffer(e.target.result)) | ||
function onLoadEnd (e) { | ||
reader.removeEventListener('loadend', onLoadEnd, false) | ||
if (e.error) cb(e.error) | ||
else cb(null, toBuffer(reader.result)) | ||
} | ||
function onError (err) { | ||
unregisterEvents() | ||
cb(err) | ||
} | ||
function unregisterEvents () { | ||
reader.removeEventListener('load', onLoad) | ||
reader.removeEventListener('error', onError) | ||
} | ||
reader.addEventListener('load', onLoad) | ||
reader.addEventListener('error', onError) | ||
reader.addEventListener('loadend', onLoadEnd, false) | ||
reader.readAsArrayBuffer(blob) | ||
} |
{ | ||
"name": "blob-to-buffer", | ||
"description": "Convert a Blob to a Buffer", | ||
"version": "1.2.2", | ||
"version": "1.2.3", | ||
"author": "Feross Aboukhadijeh <feross@feross.org> (http://feross.org/)", | ||
@@ -6,0 +6,0 @@ "bugs": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5658
39