Skip to content

Commit

Permalink
🚨 lint: fix deprecated warning
Browse files Browse the repository at this point in the history
  • Loading branch information
SigureMo committed May 19, 2024
1 parent 8cf1289 commit af35f80
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,14 @@ export function makeEmptyFile(path: string, size: number) {

export function writeFileWithOffset(path: string, data: Uint8Array, offset = 0): void {
const file = Deno.openSync(path, { write: true })
Deno.seekSync(file.rid, offset, Deno.SeekMode.Start)
Deno.writeSync(file.rid, data)
Deno.close(file.rid)
file.seekSync(offset, Deno.SeekMode.Start)
file.writeSync(data)
file.close()
}

export function print(...args: any[]): void {
const output = args.map((arg) => arg.toString()).join(' ')
const { rid } = Deno.stdout
Deno.writeSync(rid, new TextEncoder().encode(output))
Deno.stdout.writeSync(new TextEncoder().encode(output))
}

export async function hashBuffer(data: Uint8Array): Promise<string> {
Expand Down

0 comments on commit af35f80

Please sign in to comment.