Skip to content

Commit

Permalink
fix: use .subarray() instead of .slice()
Browse files Browse the repository at this point in the history
  • Loading branch information
double-beep committed Sep 21, 2024
1 parent b35c352 commit a21a3f4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/filesystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ export const replaceFileContent = async (
const original = await readFile(pathlike);

const update = Buffer.concat([
original.slice(0, startOffset),
original.subarray(0, startOffset),
Buffer.from(newContent),
original.slice(endOffset)
original.subarray(endOffset)
]);

return writeFile(pathlike, update);
Expand Down

0 comments on commit a21a3f4

Please # to comment.