All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.lib.helpers.readBlob.js Maven / Gradle / Ivy

There is a newer version: 1.7.9
Show newest version
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;




© 2015 - 2024 Weber Informatics LLC | Privacy Policy