Blob.arrayBuffer()
2023-02-05 17:24:04 79で対応済み
このpolyfillはもう必要ない
以下のpolyfillを使う
code:script.js
export const toArrayBuffer = (blob) => blob.arrayBuffer?.() ?? new Promise((resolve, reject) => {
const reader = new FileReader();
reader.onerror = reject;
reader.onload = () => {
resolve(reader.result);
};
reader.readAsArrayBuffer(blob);
});
References