abi.js
Version:
[![typescript-icon]][typescript-link] [![license-icon]][license-link] [![status-icon]][status-link] [![ci-icon]][ci-link] [![twitter-icon]][twitter-link]
23 lines (22 loc) • 795 B
TypeScript
/**
* Return the relative path from `from` to `to` based on current working directory.
*
* An example in windws, for instance:
* from = 'C:\\orandea\\test\\aaa'
* to = 'C:\\orandea\\impl\\bbb'
* The output of the function should be: '..\\..\\impl\\bbb'
*
* @example Usage
* ```ts
* import { relative } from "@std/path/windows/relative";
* import { assertEquals } from "@std/assert";
*
* const relativePath = relative("C:\\foobar\\test\\aaa", "C:\\foobar\\impl\\bbb");
* assertEquals(relativePath, "..\\..\\impl\\bbb");
* ```
*
* @param from The path from which to calculate the relative path
* @param to The path to which to calculate the relative path
* @returns The relative path from `from` to `to`
*/
export declare function relative(from: string, to: string): string;