b5f3067a6a
Initial setup of project dependencies including axios, express, dotenv, and other supporting packages. Added configuration files and documentation for project setup and usage.
16 lines
318 B
JavaScript
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;
|