source: imaps-frontend/node_modules/axios/lib/helpers/readBlob.js

main
Last change on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 318 bytes
RevLine 
[d565449]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.