@adviser/cement - v0.0.0
    Preparing search index...

    Function isURL

    • Type guard to check if a value is a URL object.

      Checks both for instanceof URL and for objects with URL-like properties (searchParams object with sort method, hash string), allowing it to work with URL objects from different execution contexts.

      Parameters

      • value: unknown

        The value to check

      Returns value is URL

      True if the value is a URL or URL-like object

      const value: unknown = new URL('https://example.com');
      if (isURL(value)) {
      console.log(value.hostname); // "example.com"
      }