diff options
author | Nathan Whitaker <17734409+nathanwhit@users.noreply.github.com> | 2024-08-14 09:42:31 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-14 09:42:31 -0700 |
commit | 1f2d48cd975b719f0248e471f3b503cb01398dfb (patch) | |
tree | f9ac89ff011566aad45456e6d49e2802ce6f345b /ext/node/polyfills/_fs/_fs_common.ts | |
parent | c765d9ad2fbd82be1b025cae3930fdfe8e30f9e2 (diff) |
fix(node/fs): node:fs.read and write should accept typed arrays other than Uint8Array (#25030)
Part of #25028.
Our underlying read/write operations in `io` assume the buffer is a
Uint8Array, but we were passing in other typed arrays (in the case above
it was `Int8Array`).
Diffstat (limited to 'ext/node/polyfills/_fs/_fs_common.ts')
-rw-r--r-- | ext/node/polyfills/_fs/_fs_common.ts | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/node/polyfills/_fs/_fs_common.ts b/ext/node/polyfills/_fs/_fs_common.ts index 069f9a3a1..ac0bf5a55 100644 --- a/ext/node/polyfills/_fs/_fs_common.ts +++ b/ext/node/polyfills/_fs/_fs_common.ts @@ -38,7 +38,7 @@ export type BinaryOptionsArgument = export type FileOptionsArgument = Encodings | FileOptions; export type ReadOptions = { - buffer: Buffer | Uint8Array; + buffer: Buffer | ArrayBufferView; offset: number; length: number; position: number | null; |