Skip to content

Commit

Permalink
Remove Buffer usage from index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
valadaptive committed Mar 30, 2024
1 parent c9eda66 commit ca2f30b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function extractFileHeader(path, opts) {

let decode = opts.decode === undefined ? true : !!opts.decode;
let size = Math.max(opts.size || 4096, 4);
let buf = Buffer.alloc(size);
let buf = new Uint8Array(size);
let tap = new utils.Tap(buf);
let fd = fs.openSync(path, 'r');

Expand Down Expand Up @@ -56,7 +56,7 @@ function extractFileHeader(path, opts) {
return true;
}
let len = 2 * tap.length;
let buf = Buffer.alloc(len);
let buf = new Uint8Array(len);
len = fs.readSync(fd, buf, 0, len);
tap.append(buf);
return false;
Expand Down

0 comments on commit ca2f30b

Please sign in to comment.