-
-
Notifications
You must be signed in to change notification settings - Fork 0
url
Nicholas Berlette edited this page Jun 19, 2025
·
1 revision
function isURL(it: unknown): it is URL;| Name | Info |
|---|---|
it |
The value to check. |
true if the value is a URL object, false otherwise.
Web APIs
import { isURL } from "jsr:@nick/is/url";
console.log(isURL(new URL("https://example.com"))); // true
console.log(isURL(new URL("https://example.com").toString())); // false
console.log(isURL({ href: "https://example.com" })); // false
console.log(isURL({ ...new URL("https://example.com") })); // false