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
The given sequence of paths is processed from right to left, with each subsequent path prepended until an absolute path is constructed. For instance, given the sequence of path segments: /foo, /bar, baz, calling path.resolve('/foo', '/bar', 'baz') would return /bar/baz.
This is something a bit diffucult to grab when in hurry (first though is: why that wouldn't be /foo/bar/baz?). One thing is "prepend" is meant not literally (otherwise that would be /barbaz). The other is the whole idea is not very usual. My suggestion is to expand this into:
The given sequence of paths is processed from right to left, with each subsequent path prepended until an absolute path is constructed. For instance, given the sequence of path segments: /foo, /bar, baz, calling path.resolve('/foo', '/bar', 'baz') would return /bar/baz because 'baz' is not an absolute path but '/bar' + '/' + 'baz' is.
But may be this is trivial for others, so I'd like to get some feedback before creating a PR.
Activity
gireeshpunathil commentedon Jan 4, 2020
👍
👍
JLeClerc commentedon Jan 16, 2020
+1 to this. It could use some clarification.
doc: add explanation bit to path.resolve description
doc: add explanatory to path.resolve description
doc: add explanatory to path.resolve description
doc: add explanatory to path.resolve description