Skip to content

Commit

Permalink
ref(ipos): /utils/format.ts cleaner getUint8ArrayFromFile impleme…
Browse files Browse the repository at this point in the history
…ntation
  • Loading branch information
hassnian committed Jul 10, 2024
1 parent a4f1624 commit 6a9f4ef
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions services/ipos/src/utils/format.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { Buffer } from 'node:buffer'

export async function getUint8ArrayFromFile(file: File) {
const arrayBuffer = await file.arrayBuffer()
const buffer = Buffer.from(arrayBuffer)
return Uint8Array.from(buffer)
export async function getUint8ArrayFromFile(file: File): Promise<Uint8Array> {
return new Uint8Array(await file.arrayBuffer())
}

export function getObjectSize(obj: Record<string, any>) {
Expand Down

0 comments on commit 6a9f4ef

Please sign in to comment.