mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-21 17:18:52 +00:00
Add utility function for getting binary arrays out of zips
This commit is contained in:
parent
81fa6010e8
commit
326c37d149
1 changed files with 8 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue