162
}
163
164
>
async function openZip(zipFile: string, lazy: boolean = false): Promise<ZipFile> {
zip.ts
165
>
const { open } = await import('yauzl');
166
>
167
>
return new Promise<ZipFile>((resolve, reject) => {
168
>
open(zipFile, lazy ? { lazyEntries: true } : undefined!, (error: Error | null, zipfile?: ZipFile) => {
169
>
if (error) {
170
reject(toExtractError(error));
172
>
resolve(assertReturnsDefined(zipfile));
173
>
}
174
>
});
175
>
});
176
>
}
177
178
function openZipStream(zipFile: ZipFile, entry: Entry): Promise<Readable> {