mahiatlinux's picture
Upload 3053 files
311cc15 verified
raw
history blame contribute delete
318 Bytes
const {asyncIterator} = Symbol;
const readBlob = async function* (blob) {
if (blob.stream) {
yield* blob.stream()
} else if (blob.arrayBuffer) {
yield await blob.arrayBuffer()
} else if (blob[asyncIterator]) {
yield* blob[asyncIterator]();
} else {
yield blob;
}
}
export default readBlob;