UNPKG

abi.js

Version:

[![typescript-icon]][typescript-link] [![license-icon]][license-link] [![status-icon]][status-link] [![ci-icon]][ci-link] [![twitter-icon]][twitter-link]

19 lines (18 loc) 620 B
/** * Normalize the `path`, resolving `'..'` and `'.'` segments. * Note that resolving these segments does not necessarily mean that all will be eliminated. * A `'..'` at the top-level will be preserved, and an empty path is canonically `'.'`. * * @example Usage * ```ts * import { normalize } from "@std/path/windows/normalize"; * import { assertEquals } from "@std/assert"; * * const normalized = normalize("C:\\foo\\..\\bar"); * assertEquals(normalized, "C:\\bar"); * ``` * * @param path The path to normalize * @returns The normalized path */ export declare function normalize(path: string): string;