Commit 23ef3e4c authored by ZYSzys's avatar ZYSzys Committed by Rich Trott
Browse files

fs: extract path conversion and validation to getValidatedPath

Almost all path validations within our file system are combined with:
```js
path = toPathIfFileURL(path);
validatePath(path);
```

So simply extracted them out into `getValidatedPath` function to
`internal/fs/utils.js` to DRY up the code and reduce duplicating them.

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


Reviewed-By: default avatarRuben Bridgewater <ruben@bridgewater.de>
Reviewed-By: default avatarJames M Snell <jasnell@gmail.com>
Reviewed-By: default avatarAnto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: default avatarRich Trott <rtrott@gmail.com>
parent 4a18b87a
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