14 lines
264 B
TypeScript
14 lines
264 B
TypeScript
import { unzip } from 'fflate';
|
|
|
|
export const unzipArchive = (data: Uint8Array) =>
|
|
new Promise<Record<string, Uint8Array>>((resolve, reject) => {
|
|
unzip(data, (error, files) => {
|
|
if (error) {
|
|
reject(error);
|
|
return;
|
|
}
|
|
|
|
resolve(files);
|
|
});
|
|
});
|