Parses an Accept-Language header under a bound.
Accept-Language
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.
q=0
excluded
preferred
q
The raw header value (null or empty when absent)
null
The ordered preferences and the explicit exclusions
parseAcceptLanguage('fr;q=0.5, de, en;q=0');// { preferred: ['de', 'fr'], excluded: ['en'] } Copy
parseAcceptLanguage('fr;q=0.5, de, en;q=0');// { preferred: ['de', 'fr'], excluded: ['en'] }
0.9.0
Parses an
Accept-Languageheader 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=0are returned inexcluded; the rest inpreferred, ordered byqdescending and stable on ties.