For a zip file that looks like:
var zip = new JSZip();
zip.load(arrayBuffer);
var subfolder = zip.folder('subfolder');
var content = subfolder.generate({type: "blob"});
As JSZip.folder sets the root, I expected that content would be restricted to just the files within subfolder, i.e.:
Instead I just get the original zip contents. I have managed to produce the expected behaviour with:
var subfolder = zip.folder('subfolder');
subfolder.files = subfolder.file(/*/);
var content = subfolder.generate({type: "blob"});
For a zip file that looks like:
As
JSZip.foldersets the root, I expected thatcontentwould be restricted to just the files withinsubfolder, i.e.:Instead I just get the original zip contents. I have managed to produce the expected behaviour with: