import { relativePathname } from "https://deno.land/x/enzastdlib@v0.0.4/path/mod.ts";
Returns the pathname of to
as relative to from
.
Examples
Example 1
Example 1
import { assertEquals } from 'https://deno.land/std/testing/asserts.ts';
import { relativePathname } from 'https://deno.land/x/enzastdlib/path/mod.ts';
const URL_A = new URL("https://example.domain/assets");
const URL_B = new URL("https://example.domain/assets/scripts/main.js");
assertEquals(
relativePathname(URL_A, URL_B),
'scripts/main.js'
);