Add `arrayBufferToObjectURL` module
parent
e5d90775d0
commit
cad5e417f3
@ -0,0 +1,15 @@
|
||||
/**
|
||||
* @prettier
|
||||
*/
|
||||
import { MIMEType } from '../types/MIME';
|
||||
|
||||
export const arrayBufferToObjectURL = ({
|
||||
data,
|
||||
type,
|
||||
}: {
|
||||
data: ArrayBuffer;
|
||||
type: MIMEType;
|
||||
}): string => {
|
||||
const blob = new Blob([data], { type });
|
||||
return URL.createObjectURL(blob);
|
||||
};
|
Loading…
Reference in New Issue