Skip to content

Commit

Permalink
doc: add explanatory to path.resolve description
Browse files Browse the repository at this point in the history
Fixes: #25542

PR-URL: #31430
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
  • Loading branch information
YakovL authored and codebytere committed Feb 17, 2020
1 parent 049a172 commit 67d8967
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion doc/api/path.md
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,8 @@ an absolute path.
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`.
calling `path.resolve('/foo', '/bar', 'baz')` would return `/bar/baz`
because `'baz'` is not an absolute path but `'/bar' + '/' + 'baz'` is.

If after processing all given `path` segments an absolute path has not yet
been generated, the current working directory is used.
Expand Down

0 comments on commit 67d8967

Please sign in to comment.