tvbox_config/open/node_modules/axios/lib/helpers/readBlob.js
liushiquan 36ab603d34 init
2024-06-01 22:41:46 +08:00

16 lines
318 B
JavaScript

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;