From b5da89431a7515ee2b31f0a153ebd47445cd0488 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Fri, 14 Aug 2015 10:25:10 -0700 Subject: [PATCH] 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 PR-URL: https://github.com/nodejs/node/pull/2378 --- doc/api/path.markdown | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/api/path.markdown b/doc/api/path.markdown index 7177ab4d2d0b99..f879d462a29d65 100644 --- a/doc/api/path.markdown +++ b/doc/api/path.markdown @@ -183,6 +183,10 @@ an empty string. Examples: // returns '' + path.extname('.index') + // returns + '' + ## path.sep The platform-specific file separator. `'\\'` or `'/'`.