abi.js
Version:
[![typescript-icon]][typescript-link] [![license-icon]][license-link] [![status-icon]][status-link] [![ci-icon]][ci-link] [![twitter-icon]][twitter-link]
20 lines (19 loc) • 590 B
TypeScript
/**
* Return the relative path from `from` to `to` based on current working directory.
*
* If `from` and `to` are the same, return an empty string.
*
* @example Usage
* ```ts
* import { relative } from "@std/path/posix/relative";
* import { assertEquals } from "@std/assert";
*
* const path = relative("/data/orandea/test/aaa", "/data/orandea/impl/bbb");
* assertEquals(path, "../../impl/bbb");
* ```
*
* @param from The path to start from.
* @param to The path to reach.
* @returns The relative path.
*/
export declare function relative(from: string, to: string): string;