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:
James M Snell authored and Rod Vagg committed 2015-08-26 21:18:56 +10:00
1 parent 1d4ea609db
commit b5da89431a
1 file changed
+4
+4
View File
@@ -183,6 +183,10 @@ an empty string. Examples:
// returns
''
path.extname('.index')
// returns
''
## path.sep
The platform-specific file separator. `'\\'` or `'/'`.