Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async openFileSystem(basePath: string | Uint8Array): Promise {
if (typeof basePath === "string") {
const stat = await promises.stat(basePath);
if (stat.isDirectory()) {
return new DefaultFS(basePath);
} else {
const zip = await Unzip.open(basePath, { lazyEntries: false });
return new ZipFS(basePath, zip);
}
} else {
const zip = await Unzip.open(basePath as Buffer, { lazyEntries: false });
return new ZipFS("", zip);
}
}
decodeBase64(input: string): string {
async openFileSystem(basePath: string | Uint8Array): Promise {
if (typeof basePath === "string") {
const stat = await promises.stat(basePath);
if (stat.isDirectory()) {
return new DefaultFS(basePath);
} else {
const zip = await Unzip.open(basePath, { lazyEntries: false });
return new ZipFS(basePath, zip);
}
} else {
const zip = await Unzip.open(basePath as Buffer, { lazyEntries: false });
return new ZipFS("", zip);
}
}
decodeBase64(input: string): string {