Setu-TS
    Preparing search index...
    • Parses an Accept-Language header under a bound.

      The value is sliced to 1024 characters before splitting, at most 16 ranges are read, and a range longer than 35 characters is dropped. Ranges with q=0 are returned in excluded; the rest in preferred, ordered by q descending and stable on ties.

      Parameters

      • value: string | null | undefined

        The raw header value (null or empty when absent)

      Returns AcceptLanguage

      The ordered preferences and the explicit exclusions

      parseAcceptLanguage('fr;q=0.5, de, en;q=0');
      // { preferred: ['de', 'fr'], excluded: ['en'] }

      0.9.0