Unverified Commit fb6df3bf authored by Ruben Bridgewater's avatar Ruben Bridgewater
Browse files

fs: validate the input data to be of expected types

The input was not validated so far and that caused unwanted side
effects. E.g., `undefined` became the string `'undefined'`. It was
expected to fail or to end up as empty string.
Now all input is validated to be either some type of array buffer
view or a string. That way it's always clear what the user intents.

PR-URL: https://github.com/nodejs/node/pull/31030
Fixes: https://github.com/nodejs/node/issues/31025


Reviewed-By: default avatarRich Trott <rtrott@gmail.com>
Reviewed-By: default avatarYongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: default avatarJames M Snell <jasnell@gmail.com>
Reviewed-By: default avatarMatteo Collina <matteo.collina@gmail.com>
Reviewed-By: default avatarGireesh Punathil <gpunathi@in.ibm.com>
parent 2d8febce
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