Add utility function for getting binary arrays out of zips

This commit is contained in:
Jordan Eldredge 2019-07-19 20:59:14 -07:00
parent 81fa6010e8
commit 326c37d149

View file

@ -15,6 +15,14 @@ export async function readXml(zip, filepath) {
return xml2js(text, { compact: false, elementsKey: "children" });
}
export async function readUint8array(zip, filepath) {
const file = await getCaseInsensitveFile(zip, filepath);
if (file == null) {
return null;
}
return file.async("uint8array");
}
// Transform an xml tree structure by mapping over each node breadth first
// Parents are mapped before their children
// Children are mapped in parallel