import { URLPattern } from "https://deno.land/x/deno@v1.30.0/cli/tsc/dts/lib.dom.extras.d.ts";
Test if the given input matches the stored pattern.
The input can either be provided as a url string (with an optional base), or as individual components in the form of an object.
const pattern = new URLPattern("https://example.com/books/:id");
// Test a url string.
console.log(pattern.test("https://example.com/books/123")); // true
// Test a relative url with a base.
console.log(pattern.test("/books/123", "https://example.com")); // true
// Test an object of url components.
console.log(pattern.test({ pathname: "/books/123" })); // true
Parameters
input: URLPatternInput