UNPKG

rvx

Version:

A signal based rendering library

33 lines (32 loc) 1.29 kB
/** * Normalize a path: * + Empty paths are represented as an empty string. * + Non-empty paths start with a slash. * * @param path The path to normalize. * @param preserveDir True to keep trailing slashes in non-empty paths. Default is `true`. * @returns The normalized path. */ export declare function normalize(path: string, preserveDir?: boolean): string; /** * Join two paths. * * Note, that this dosn't handle empty, ".." or "." parts. * * @param parent The parent path. * @param child The child path. * @param preserveDir True to keep trailing slashes. Default is `true`. * @returns A {@link normalize normalized} path. */ export declare function join(parent: string, child: string, preserveDir?: boolean): string; /** * Get a normalized relative path. * * Note, that this dosn't handle empty, ".." or "." parts, but inserts ".." parts if necessary. * * @param from The path from which the relative path starts. * @param to The path to which the relative path points. * @param preserveDir True to keep trailing slashes from the `to` path. Trailing slashes from the `from` path are always discarded. Default is `true`. * @returns A {@link normalize normalized} path. */ export declare function relative(from: string, to: string, preserveDir?: boolean): string;