Skip to content

Commit 611e371

Browse files
committed
Fix for Node.js
1 parent 81d8929 commit 611e371

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.16.1
2+
3+
- Fix for Node.js not treating subarrays of buffers as expected
4+
15
## 0.16.0
26

37
**Breaking change, databases created using earlier versions is not compatible

deno.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@cross/kv",
3-
"version": "0.16.0",
3+
"version": "0.16.1",
44
"exports": {
55
".": "./mod.ts",
66
"./cli": "./src/cli/mod.ts"

src/lib/utils/file.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,9 @@ export async function readAtPosition(
7373
0,
7474
length,
7575
position,
76-
// deno-lint-ignore no-explicit-any
77-
) as FileReadResult<any>;
76+
) as FileReadResult<Uint8Array>;
7877
const bytesRead = readResult.bytesRead as number;
79-
return buffer.subarray(0, bytesRead);
78+
return new Uint8Array(buffer.buffer, 0, bytesRead);
8079
}
8180
}
8281

0 commit comments

Comments
 (0)