mirror of
https://github.com/nodejs/node.git
synced 2026-11-26 21:58:26 -05:00
doc: add explanatory to path.resolve description
Fixes: https://github.com/nodejs/node/issues/25542 PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
1 parent
8438d1498d
commit
11dbdcb839
1 file changed
+2
-1
+2
-1
@@ -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.
|
||||
|
||||
Reference in new issue
Block a user