You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
v12 - avoid needless data copying in fs.promises.writeFileHandle when called with Uint8Array #35343
If data is a Uint8Array, the local variable buffer will actually be a Uint8Array object. Calling .slice on a Uint8Array creates a shallow copy of the values. This is documented both on MDN and in the node documentation.
Describe the solution you'd like
Don't use .slice on Uint8Arrays
Describe alternatives you've considered
Manually making a Buffer out of my Uint8Array before calling fs write functions.
Thanks for all your hard work in making Node awesome!
Activity
fs: fix fs.promises.writeFile with typed arrays
fs: fix fs.promises.writeFile with typed arrays
fs: fix fs.promises.writeFile with typed arrays
fs: fix fs.promises.writeFile with typed arrays