@oazmi/build-tools
Version:
general deno build tool scripts which I practically use in all of my typescript repos
25 lines • 748 B
TypeScript
/**
* Return the last portion of a path.
*
* The trailing directory separators are ignored, and optional suffix is
* removed.
*
* @example Usage
* ```ts
* import { basename } from "@std/path/basename";
* import { assertEquals } from "@std/assert/assert-equals";
*
* if (Deno.build.os === "windows") {
* assertEquals(basename("C:\\user\\Documents\\image.png"), "image.png");
* } else {
* assertEquals(basename("/home/user/Documents/image.png"), "image.png");
* }
* ```
*
* @param path Path to extract the name from.
* @param suffix Suffix to remove from extracted name.
*
* @returns The basename of the path.
*/
export declare function basename(path: string, suffix?: string): string;
//# sourceMappingURL=basename.d.ts.map