Skip to content

Commit 515182a

Browse files
authored
fix: Specify Generic for readFile ArrayBuffer (fix #2914) (#2915)
1 parent d3d290a commit 515182a

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
fs: patch
3+
fs-js: patch
4+
---
5+
6+
`readFile` now returns a more specific type `Promise<Uint8Array<ArrayBuffer>>` instead of the default `Promise<Uint8Array<ArrayBufferLike>`

plugins/fs/guest-js/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,7 @@ interface ReadFileOptions {
739739
async function readFile(
740740
path: string | URL,
741741
options?: ReadFileOptions
742-
): Promise<Uint8Array> {
742+
): Promise<Uint8Array<ArrayBuffer>> {
743743
if (path instanceof URL && path.protocol !== 'file:') {
744744
throw new TypeError('Must be a file URL.')
745745
}

0 commit comments

Comments
 (0)