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

    Function parseItem

    • Parses an item field value.

      Note

      Reads a value a field states on its own, as Content-Type and Content-Disposition do, and equally one element of a list already split with parseList. Leading and trailing whitespace is trimmed away.

      The shape recurs across field definitions rather than being defined once, Content-Type, the q weights and the Link parameters among them; RFC 9651 later codified it as a typed structured field, whose types this reads as plain text.

      The value is reported as stated, as its case-sensitivity depends on the field, and unquoted and unescaped where stated as a quoted string; a value left unstated is reported as empty. Parameter names are case-insensitive and reported in lowercase; where a name is repeated, the last value wins.

      The item is reported as stated and never rejected: nothing is checked against the field grammar. A value opening a quote it doesn't close isn't taken as quoted and is reported verbatim, quote included; whitespace around an equals sign, which the grammar forbids, is reported as part of the parameter name and of its value.

      Parameters

      • value: Nullable<string>

        The field value to be parsed, possibly missing

      Returns readonly [string, ReadonlyMap<string, string>]

      An immutable pair of the value value opens with and an immutable map of the parameters qualifying it, keyed by lowercase name; both empty if value is missing or states nothing