@eroyeroy/utils - v0.1.0
    Preparing search index...

    Function getQueryParam

    • Returns the value of a query parameter from a URL string. Returns null if the parameter is absent or the URL is invalid.

      Parameters

      • url: string

        The URL string.

      • param: string

        The query parameter name.

      Returns string | null

      getQueryParam("https://example.com?q=hello", "q") // => "hello"
      getQueryParam("https://example.com", "q") // => null