Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
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
Prev Previous commit
Next Next commit
doc: update path.extname documentation
per: nodejs/node-v0.x-archive#8509

originally submitted by @thauburger

Adding an additional example to path.extname documentation
to demonstrate the case where the first character of the last
path component is '.'. This case is interesting, as something
like path.extname('.txt') returns an empty string. In this
case, .txt can be used as a valid file name (while arguably
maintaining an extension). I agree with Node's behavior in this
case, but I think the added example provides additional clarity
for the developer.
  • Loading branch information
jasnell committed Aug 26, 2015
commit 3d5056faa7c98e1d82e9744f2769b98240ac0a03
4 changes: 4 additions & 0 deletions doc/api/path.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,10 @@ an empty string. Examples:
// returns
''

path.extname('.index')
// returns
''

## path.sep

The platform-specific file separator. `'\\'` or `'/'`.
Expand Down