Skip to content

Commit 860f9f8

Browse files
committed
Update documentation comments
1 parent d62a11f commit 860f9f8

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

src/compiler/core.ts

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2134,7 +2134,7 @@ namespace ts {
21342134
* Returns the path except for its basename. Semantics align with NodeJS's `path.dirname`
21352135
* except that we support URL's as well.
21362136
*
2137-
* ```js
2137+
* ```ts
21382138
* getDirectoryPath("/path/to/file.ext") === "/path/to"
21392139
* getDirectoryPath("/path/to/") === "/path"
21402140
* getDirectoryPath("/") === "/"
@@ -2145,7 +2145,7 @@ namespace ts {
21452145
* Returns the path except for its basename. Semantics align with NodeJS's `path.dirname`
21462146
* except that we support URL's as well.
21472147
*
2148-
* ```js
2148+
* ```ts
21492149
* getDirectoryPath("/path/to/file.ext") === "/path/to"
21502150
* getDirectoryPath("/path/to/") === "/path"
21512151
* getDirectoryPath("/") === "/"
@@ -2332,14 +2332,25 @@ namespace ts {
23322332
}
23332333

23342334
/**
2335-
* Gets the portion of a path following the last separator (`/`).
2335+
* Returns the path except for its containing directory name.
23362336
* Semantics align with NodeJS's `path.basename` except that we support URL's as well.
2337+
*
2338+
* ```ts
2339+
* getBaseFileName("/path/to/file.ext") === "file.ext"
2340+
* getBaseFileName("/path/to/") === "to"
2341+
* getBaseFileName("/") === ""
2342+
* ```
23372343
*/
23382344
export function getBaseFileName(path: string): string;
23392345
/**
2340-
* Gets the portion of a path following the last separator (`/`).
2346+
* Gets the portion of a path following the last (non-terminal) separator (`/`).
23412347
* Semantics align with NodeJS's `path.basename` except that we support URL's as well.
23422348
* If the base name has any one of the provided extensions, it is removed.
2349+
*
2350+
* ```ts
2351+
* getBaseFileName("/path/to/file.ext", ".ext", true) === "file"
2352+
* getBaseFileName("/path/to/file.js", ".ext", true) === "file.js"
2353+
* ```
23432354
*/
23442355
export function getBaseFileName(path: string, extensions: string | ReadonlyArray<string>, ignoreCase: boolean): string;
23452356
export function getBaseFileName(path: string, extensions?: string | ReadonlyArray<string>, ignoreCase?: boolean) {

0 commit comments

Comments
 (0)