@metreeca/http - v0.1.1
    Preparing search index...

    Function parseParameter

    • Parses a name / value pair.

      Note

      Reads one parameter of an item and equally one directive of a field stating name / value directives, Cache-Control among them, the two differing only in whether the value is optional. Names are case-insensitive and reported in lowercase; a value stated as a quoted string is unquoted and unescaped, and one left unstated is reported as empty, so presence alone answers a flag.

      Parameters

      • parameter: string

        The name / value pair to be parsed

      Returns readonly [string, string]

      An immutable pair of the lowercase name parameter states and the value it states past the first equals sign, empty if unstated

      Mapped over parseList, this reads a field keyed by name, Map resolving a repeated name last-wins as those fields prescribe.

      new Map(parseList(headers.get("cache-control")).map(directive => parseParameter(directive)));