Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
program.args.slice(1).forEach((x: string) => {
const data: X.CFB$Entry = X.find(cfb, x);
if(!data) { console.error(x + ": file not found"); return; }
if(data.type !== 2) { console.error(x + ": not a file"); return; }
const idx = cfb.FileIndex.indexOf(data), path = cfb.FullPaths[idx];
mkdirp(path.slice(0, path.lastIndexOf("/")));
write(path, data);
});
exit(0);