Skip to content

Commit

Permalink
Fix for Node.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Hexagon committed Jun 15, 2024
1 parent 81d8929 commit 611e371
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.16.1

- Fix for Node.js not treating subarrays of buffers as expected

## 0.16.0

**Breaking change, databases created using earlier versions is not compatible
Expand Down
2 changes: 1 addition & 1 deletion deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cross/kv",
"version": "0.16.0",
"version": "0.16.1",
"exports": {
".": "./mod.ts",
"./cli": "./src/cli/mod.ts"
Expand Down
5 changes: 2 additions & 3 deletions src/lib/utils/file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,9 @@ export async function readAtPosition(
0,
length,
position,
// deno-lint-ignore no-explicit-any
) as FileReadResult<any>;
) as FileReadResult<Uint8Array>;
const bytesRead = readResult.bytesRead as number;
return buffer.subarray(0, bytesRead);
return new Uint8Array(buffer.buffer, 0, bytesRead);
}
}

Expand Down

0 comments on commit 611e371

Please sign in to comment.