bakalarska_praca/database/node_modules/axios/lib/helpers/readBlob.js

16 lines
318 B
JavaScript
Raw Permalink Normal View History

2023-05-11 19:57:12 +00:00
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;