@@ -2134,7 +2134,7 @@ namespace ts {
2134
2134
* Returns the path except for its basename. Semantics align with NodeJS's `path.dirname`
2135
2135
* except that we support URL's as well.
2136
2136
*
2137
- * ```js
2137
+ * ```ts
2138
2138
* getDirectoryPath("/path/to/file.ext") === "/path/to"
2139
2139
* getDirectoryPath("/path/to/") === "/path"
2140
2140
* getDirectoryPath("/") === "/"
@@ -2145,7 +2145,7 @@ namespace ts {
2145
2145
* Returns the path except for its basename. Semantics align with NodeJS's `path.dirname`
2146
2146
* except that we support URL's as well.
2147
2147
*
2148
- * ```js
2148
+ * ```ts
2149
2149
* getDirectoryPath("/path/to/file.ext") === "/path/to"
2150
2150
* getDirectoryPath("/path/to/") === "/path"
2151
2151
* getDirectoryPath("/") === "/"
@@ -2332,14 +2332,25 @@ namespace ts {
2332
2332
}
2333
2333
2334
2334
/**
2335
- * Gets the portion of a path following the last separator (`/`) .
2335
+ * Returns the path except for its containing directory name .
2336
2336
* 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
+ * ```
2337
2343
*/
2338
2344
export function getBaseFileName ( path : string ) : string ;
2339
2345
/**
2340
- * Gets the portion of a path following the last separator (`/`).
2346
+ * Gets the portion of a path following the last (non-terminal) separator (`/`).
2341
2347
* Semantics align with NodeJS's `path.basename` except that we support URL's as well.
2342
2348
* 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
+ * ```
2343
2354
*/
2344
2355
export function getBaseFileName ( path : string , extensions : string | ReadonlyArray < string > , ignoreCase : boolean ) : string ;
2345
2356
export function getBaseFileName ( path : string , extensions ?: string | ReadonlyArray < string > , ignoreCase ?: boolean ) {
0 commit comments