Skip to content

Commit

Permalink
doc: update path.extname documentation
Browse files Browse the repository at this point in the history
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.

Reviewed By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
PR-URL: #2378
  • Loading branch information
jasnell authored and rvagg committed Aug 26, 2015
1 parent 1d4ea60 commit b5da894
Showing 1 changed file with 4 additions and 0 deletions.
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

0 comments on commit b5da894

Please sign in to comment.