|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 13 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
323 bytes
|
| Rev | Line | |
|---|
| [9af201e] | 1 | const { asyncIterator } = Symbol;
|
|---|
| 2 |
|
|---|
| 3 | const 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 |
|
|---|
| 15 | export default readBlob;
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.