import { isSubURL } from "https://deno.land/x/enzastdlib@v0.0.4/path/mod.ts";
Returns if the child
is a sub-URL of the parent
.
Examples
Example 1
Example 1
import { assertEquals } from 'https://deno.land/std/testing/asserts.ts';
import { isSubURL } 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(
isSubURL(URL_A, URL_B),
true
);