File tree 1 file changed +6
-3
lines changed
1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -157,9 +157,9 @@ changes:
157
157
158
158
The ` path.extname() ` method returns the extension of the ` path ` , from the last
159
159
occurrence of the ` . ` (period) character to end of string in the last portion of
160
- the ` path ` . If there is no ` . ` in the last portion of the ` path ` , or if the
161
- first character of the basename of ` path ` (see ` path.basename() ` ) is ` . ` , then
162
- an empty string is returned.
160
+ the ` path ` . If there is no ` . ` in the last portion of the ` path ` , or if
161
+ there are no ` . ` characters other than the first character of
162
+ the basename of ` path ` (see ` path.basename() ` ) , an empty string is returned.
163
163
164
164
``` js
165
165
path .extname (' index.html' );
@@ -176,6 +176,9 @@ path.extname('index');
176
176
177
177
path .extname (' .index' );
178
178
// Returns: ''
179
+
180
+ path .extname (' .index.md' );
181
+ // Returns: '.md'
179
182
```
180
183
181
184
A [ ` TypeError ` ] [ ] is thrown if ` path ` is not a string.
You can’t perform that action at this time.
0 commit comments