Skip to content

Commit

Permalink
fs: extract path conversion and validation to getValidatedPath
Browse files Browse the repository at this point in the history
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: nodejs#27656
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
  • Loading branch information
ZYSzys authored and Trott committed May 14, 2019
1 parent 4a18b87 commit 23ef3e4
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 153 deletions.
Loading

0 comments on commit 23ef3e4

Please sign in to comment.