UNPKG

@flex-development/pathe

Version:

Universal drop-in replacement for node:path

26 lines (25 loc) 648 B
/** * @file basename * @module pathe/lib/basename */ /** * Get the last portion of `input`, similar to the Unix `basename` command. * * Trailing [directory separators][sep] are ignored. * * [sep]: https://nodejs.org/api/path.html#pathsep * * @category * core * * @this {void} * * @param {URL | string} input * The {@linkcode URL}, URL string, or path to handle * @param {string | null | undefined} [suffix] * The suffix to remove * @return {string} * Last portion of `input` or empty string */ declare function basename(this: void, input: URL | string, suffix?: string | null | undefined): string; export default basename;