mirror of
https://github.com/nodejs/node.git
synced 2026-11-29 14:27:57 -05:00
doc: update path.extname documentation
per: https://github.com/joyent/node/pull/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: https://github.com/nodejs/node/pull/2378
This commit is contained in:
1 parent
1d4ea609db
commit
b5da89431a
1 file changed
+4
@@ -183,6 +183,10 @@ an empty string. Examples:
|
||||
// returns
|
||||
''
|
||||
|
||||
path.extname('.index')
|
||||
// returns
|
||||
''
|
||||
|
||||
## path.sep
|
||||
|
||||
The platform-specific file separator. `'\\'` or `'/'`.
|
||||
|
||||
Reference in new issue
Block a user