UNPKG

@flex-development/pathe

Version:

Universal drop-in replacement for node:path

63 lines (62 loc) 1.51 kB
/** * @file toPosix * @module pathe/lib/toPosix */ export default toPosix; /** * Make separators in `input` POSIX-compliant. * * Supports encoded separators (e.g. `%5C`, `%5c`). * * @category * utils * * @template {URL | string} Input * The URL or path to handle * * @this {void} * * @param {Input} input * The {@linkcode URL}, URL string, or path to handle * @return {Input} * `input` with POSIX-compliant separators */ declare function toPosix<Input extends URL | string>(this: void, input: Input): Input; /** * Make separators in `list` POSIX-compliant. * * Supports encoded separators (e.g. `%5C`, `%5c`). * * @category * utils * * @template {(URL | string)[]} List * The list to handle * * @this {void} * * @param {List} list * The list of {@linkcode URL}s, URL strings, or paths to handle * @return {List} * `list` with POSIX-compliant separators */ declare function toPosix<List extends (URL | string)[]>(this: void, list: List): List; /** * Make separators in `value` POSIX-compliant. * * Supports encoded separators (e.g. `%5C`, `%5c`). * * @category * utils * * @template {URL | string} Input * The URL or path to handle * * @this {void} * * @param {Input | Input[]} value * The {@linkcode URL}, URL string, or path to handle, or list of such values * @return {Input | Input[]} * `value` with POSIX-compliant separators */ declare function toPosix<Input extends URL | string>(this: void, value: Input | Input[]): Input | Input[];