Skip to content

Commit 290faec

Browse files
himself65vsemozhetbyt
authored andcommitted
doc: fix extname with the correct description
PR-URL: #27303 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: Yongsheng Zhang <[email protected]>
1 parent 5356b4a commit 290faec

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

doc/api/path.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,9 @@ changes:
157157

158158
The `path.extname()` method returns the extension of the `path`, from the last
159159
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.
163163

164164
```js
165165
path.extname('index.html');
@@ -176,6 +176,9 @@ path.extname('index');
176176

177177
path.extname('.index');
178178
// Returns: ''
179+
180+
path.extname('.index.md');
181+
// Returns: '.md'
179182
```
180183

181184
A [`TypeError`][] is thrown if `path` is not a string.

0 commit comments

Comments
 (0)