@trashpanda001/helpers
    Preparing search index...

    Function hostname

    • Returns the hostname of the given URL or empty string.

      Parameters

      • url: undefined | null | string | URL

        the URL to parse

      Returns string

      the hostname of the URL or empty string

      import { hostname } from "@trashpanda001/helpers/string"

      hostname("https://example.com/foo")
      // "example.com"