-
Notifications
You must be signed in to change notification settings - Fork 654
feat(fs): introduce canonicalize
option to WalkOptions
#3679
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
useRealPath
option to WalkOptions
useRealPath
option to WalkOptions
I think |
Thanks for the suggestion. |
useRealPath
option to WalkOptions
resolveSymlinksToRealPaths
option to WalkOptions
Another one that comes into mind is |
Then, let me list up possible candidates here:
|
A canonical path is the general term used when a path has been normalized and all symlinks folllowed |
I have no idea whether we can call the result of Deno.realPath() a canonical path. What do you think? |
It's a canonical path...
GNU even provides an alternative... canonicalize_file_name, as the posix realpath has a design flaw. I agree with @timreichen that realpath is a bad name, but it's just an unfortunate history carried over from posix, many other languages and operating systems (including Windows) use the term canonical. Tbh, I'm surprised that Deno carried this legacy over and didn't seek to use a more accurate term like I think the choice should be down to either base the name on the correct term canonical, or on the name of the underlying fn call, ie. realPath ... throwing the terms follow or symlinks don't really help. Just my humble opinion. |
@jollytoad |
tbh, i'd suggest |
I'd like to vote for the word How does the following look to other guys? walk(b, { followSymlinks: true, normalizeSymlinks: false }) |
|
I'm persuaded. Then, let me address it. |
resolveSymlinksToRealPaths
option to WalkOptions
canonicalize
option to WalkOptions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay in review.
LGTM. Thanks for your contribution!
Introduces a new option
canonicalize
toWalkOptions
.Currently, when
followSymlinks
is enabled,walk()
function emits the canonical paths of the symlinks, which is transformed withDeno.realPath()
. However, if thefalse
is given forcanonicalize
option, the symlinks would be kept without canonicalizing.To keep the existing behavior of
walk
API,canonicalize
defaults totrue
.Example
As-is
To-be