UNPKG

@flex-development/pathe

Version:

Universal drop-in replacement for node:path

29 lines (28 loc) 841 B
/** * @file extname * @module pathe/lib/extname */ import type { EmptyString, Ext } from '@flex-development/pathe'; /** * Get the file extension of `input` from the last occurrence of the `.` (dot) * character (`.`) to end of the string in the last portion of `input`. * * If there is no `.` in the last portion of `input`, or if there are no `.` * characters other than the first character of the {@linkcode basename} of * `input`, an empty string is returned. * * @see {@linkcode EmptyString} * @see {@linkcode Ext} * * @category * core * * @this {void} * * @param {URL | string} input * The {@linkcode URL}, URL string, or path to handle * @return {EmptyString | Ext} * Extension of `input` or empty string */ declare function extname(this: void, input: URL | string): EmptyString | Ext; export default extname;