Skip to content
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

doc: clarify that path.isAbsolute on windows accepts / and \ #8291

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions doc/api/path.md
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,13 @@ path.isAbsolute('.') // false
On Windows:

```js
path.isAbsolute('//server') // true
path.isAbsolute('C:/foo/..') // true
path.isAbsolute('bar\\baz') // false
path.isAbsolute('.') // false
path.isAbsolute('//server') // true
path.isAbsolute('\\\\server') // true
path.isAbsolute('C:/foo/..') // true
path.isAbsolute('C:\\foo\\..') // true
path.isAbsolute('bar\\baz') // false
path.isAbsolute('bar/baz') // false
path.isAbsolute('.') // false
```

A [`TypeError`][] is thrown if `path` is not a string.
Expand Down Expand Up @@ -509,6 +512,10 @@ added: v0.11.15
The `path.win32` property provides access to Windows-specific implementations
of the `path` methods.

*Note*: On Windows, both the forward slash (`/`) and backward slash (`\`)
characters are accepted as path delimiters; however, only the backward slash
(`\`) will be used in return values.

[`path.posix`]: #path_path_posix
[`path.win32`]: #path_path_win32
[`path.parse()`]: #path_path_parse_path
Expand Down