Skip to content

Commit

Permalink
feat: take out arrayBuffer
Browse files Browse the repository at this point in the history
Signed-off-by: Jeroen Branje <[email protected]>
  • Loading branch information
jeroenbranje committed Nov 27, 2024
1 parent e78ff0e commit f43eb52
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const createFilename = _createFilename({
})

export const getFileFromByteArray = async (byteArray: Uint8Array, filename: string) =>
extractFromByteArray(byteArray, filename) //.then(read)
extractFromByteArray(byteArray, filename).then(read)

export const getDomainMetadataPath = (manifest: Manifest) =>
pipe(
Expand Down Expand Up @@ -102,15 +102,14 @@ export const getAllManifestLinksAndFormatPaths = (manifest: Manifest) =>
)(manifest)

export const _getPathAndBufferFromFile =
({ getFileFromByteArray }: { getFileFromByteArray: (byteArray: Uint8Array, filename: string) => Promise<Blob> }) =>
({ getFileFromByteArray }: { getFileFromByteArray: (byteArray: Uint8Array, filename: string) => Promise<string> }) =>
async (byteArray: Uint8Array, path: string, type: string) => {
const fileString = await getFileFromByteArray(byteArray, path)
const arrayBuffer = await fileString.arrayBuffer()

return {
path,
type,
buffer: Buffer.from(arrayBuffer),
buffer: Buffer.from(fileString),
}
}

Expand Down

0 comments on commit f43eb52

Please sign in to comment.