• Safely parse a string into a URL.

    Parameters

    • url: string

      The string to parse into a URL.

    Returns URL | undefined

    A URL object if the parsing is successful, undefined otherwise.