小小儁爺
2025-11-19 89513a76e1ea16d602f5d12949f61e880fafb9f6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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;