source: node_modules/axios/lib/helpers/readBlob.js@ 65b6638

main
Last change on this file since 65b6638 was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago

Initial commit

  • Property mode set to 100644
File size: 318 bytes
Line 
1const {asyncIterator} = Symbol;
2
3const readBlob = async function* (blob) {
4 if (blob.stream) {
5 yield* blob.stream()
6 } else if (blob.arrayBuffer) {
7 yield await blob.arrayBuffer()
8 } else if (blob[asyncIterator]) {
9 yield* blob[asyncIterator]();
10 } else {
11 yield blob;
12 }
13}
14
15export default readBlob;
Note: See TracBrowser for help on using the repository browser.