import { isUrl } from "https://deno.land/x/ayonli_jsext@v0.9.72/esm/path/util.js";
Checks if the given string is a URL, whether standard or non-standard.
Examples
Example 1
Example 1
import { isUrl } from "@ayonli/jsext/path";
console.assert(isUrl("http://example.com"));
console.assert(isUrl("https://example.com?foo=bar#baz"));
console.assert(isUrl("ftp://example.com")); // ftp url
console.assert(isUrl("file:///C:/Windows/System32")); // file url
console.assert(isUrl("file://localhost/C:/Windows/System32")); // file url with hostname
console.assert(isUrl("file:///usr/bin"));