From 12385eba4cf0c873dfd5e87dc472ff562c5407b3 Mon Sep 17 00:00:00 2001 From: Tom Hauburger Date: Fri, 3 Oct 2014 17:52:55 -0700 Subject: [PATCH] Update path.extname documentation Adding an additional example to `path.extname` to demonstrate the case where the first letter of the last path component is `'.'`. This case is an interesting one, as `path.extname('.txt')`, returns an empty string. In this case, `.txt` is a potentially valid file name with some semantic value as a text file (while arguably maintaining an extension). I agree with Node's behavior in this case, but I think the added example provides clarity on the method's behavior. --- doc/api/path.markdown | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/api/path.markdown b/doc/api/path.markdown index 9446a4043aa..4b710ec8dcd 100644 --- a/doc/api/path.markdown +++ b/doc/api/path.markdown @@ -163,6 +163,10 @@ an empty string. Examples: path.extname('index') // returns '' + + path.extname('.index') + // returns + '' ## path.sep