hammerspoon2-docs
    Preparing search index...

    Function urlParts

    • Parse a URL into its component parts.

      Parameters

      • url: string

        The URL string to parse.

      Returns
          | {
              fragment?: string;
              host?: string;
              password?: string;
              path: string;
              port?: number;
              query?: string;
              queryItems?: { name: string; value: string }[];
              scheme?: string;
              user?: string;
          }
          | null

      The parts of the URL, with only the fields present in it, or null if the URL is unparseable.

      • {
            fragment?: string;
            host?: string;
            password?: string;
            path: string;
            port?: number;
            query?: string;
            queryItems?: { name: string; value: string }[];
            scheme?: string;
            user?: string;
        }
        • Optionalfragment?: string

          The fragment, without the #

        • Optionalhost?: string
        • Optionalpassword?: string
        • path: string

          The path, which may be empty

        • Optionalport?: number
        • Optionalquery?: string

          The query string, without the ?

        • OptionalqueryItems?: { name: string; value: string }[]

          The items of the query string

        • Optionalscheme?: string

          e.g. "https"

        • Optionaluser?: string
      • null