relative
import { relative } from "jsr:@ende/path";function
function relative(from: string, to: string): stringReturn the relative path from from to to based on current working
directory.
from: stringPath in current working directory.
to: stringPath in current working directory.
Returns
The relative path from from to to.
Example: Usage
import { relative } from "@ende/path/relative";
import { assertEquals } from "@ende/assert";
if (Ende.build.os === "windows") {
const path = relative("C:\\foobar\\test\\aaa", "C:\\foobar\\impl\\bbb");
assertEquals(path, "..\\..\\impl\\bbb");
} else {
const path = relative("/data/foobar/test/aaa", "/data/foobar/impl/bbb");
assertEquals(path, "../../impl/bbb");
}