Commit 56e36f41 authored by Michaël Zasso's avatar Michaël Zasso Committed by Node.js GitHub Bot
Browse files

fs: fix fs.promises.writeFile with typed arrays

Before this change, only the first part of typed arrays which have more
than 1 byte per element (e.g. Uint16Array) would be written.
This also removes the use of the `slice` method to avoid unnecessary
copying the data.

Fixes: https://github.com/nodejs/node/issues/35343

PR-URL: https://github.com/nodejs/node/pull/35376


Reviewed-By: default avatarRuben Bridgewater <ruben@bridgewater.de>
Reviewed-By: default avatarZeyu Yang <himself65@outlook.com>
Reviewed-By: default avatarAnna Henningsen <anna@addaleax.net>
parent 1390574d
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment