Function parseKV

  • Efficiently parse Key-Value Strings into ValueCollections

    Type Parameters

    • Type extends "ValueCollection" | "Object"

    Parameters

    • type: Type
    • keyValue: string
    • equal: string = '='
    • splitter: string = '&'
    • decode: ((encodedURIComponent) => string) = decodeURIComponent
        • (encodedURIComponent): string
        • Gets the unencoded version of an encoded component of a Uniform Resource Identifier (URI).

          Parameters

          • encodedURIComponent: string

            A value representing an encoded URI component.

          Returns string

    Returns Type extends "ValueCollection"
        ? ValueCollection<string, string>
        : Record<string, string>

    Since

    7.0.0