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 Mar 17, 2020
1 parent 8438d14 commit 11dbdcb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion doc/api/path.md
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 11dbdcb

Please sign in to comment.