@rushstack/lockfile-explorer
Version:
Rush Lockfile Explorer: The UI for solving version conflicts quickly in a large monorepo
37 lines • 1.64 kB
TypeScript
/**
* For example, retrieves `d` from `/a/b/c/d`.
*/
export declare function getBaseNameOf(importerPath: string): string;
/**
* For example, retrieves `/a/b/c` from `/a/b/c/d`.
*/
export declare function getParentOf(importerPath: string): string;
/**
* Cheaply resolves a relative path against a base path, assuming the paths are delimited by `/`,
* and assuming the basePath is already in normal form. An error occurs if the relative path
* goes above the root folder.
*
* @example
* ```ts
* getAbsolutePath(`a/b/c`, `d/e`) === `a/b/c/d/e`
* getAbsolutePath(`/a/b/c`, `d/e`) === `/a/b/c/d/e`
* getAbsolutePath(`/a/b/c`, `/d/e`) === `/d/e`
* getAbsolutePath(`a/b/c`, `../../f`) === `a/f`
* getAbsolutePath(`a/b/c`, `.././/f`) === `a/b/f`
* getAbsolutePath(`a/b/c`, `../../..`) === `.`
* getAbsolutePath(`C:/a/b`, `../d`) === `C:/a/d`
* getAbsolutePath(`a/b/c`, `../../../..`) === ERROR
*
* // Degenerate cases:
* getAbsolutePath(`a/b/c/`, `d/`) === `a/b/c/d` // trailing slashes are discarded
* getAbsolutePath(`./../c`, `d`) === `./../c/d` // basePath assumed to be normal form
* getAbsolutePath(`C:\\`, `\\a`) === `C:\\/\\a` // backslashes not supported
* ```
*/
export declare function getAbsolute(basePath: string, relativePath: string): string;
/**
* Returns the two parts joined by exactly one `/`, assuming the parts are already
* in normalized form. The `/` is not added if either part is an empty string.
*/
export declare function join(leftPart: string, rightPart: string): string;
//# sourceMappingURL=lockfilePath.d.ts.map