Parse an Accept-Language field value or language range into a frozen array
of weighted ranges, expanded using the pinned IANA equivalence data.
Ranges are lowercase and sorted by descending weight, preserving input order
for equal weights. The first occurrence of a range or its equivalent wins.
For example, iw;q=0.9,he;q=0.4 produces iw and he, both at weight 0.9.
ASCII spaces are removed throughout the input; tabs are not removed.
Malformed ranges or invalid weights throw RangeError.
Parameters
header: string
an Accept-Language field value, or a single language range
Parse an
Accept-Languagefield value or language range into a frozen array of weighted ranges, expanded using the pinned IANA equivalence data.Ranges are lowercase and sorted by descending weight, preserving input order for equal weights. The first occurrence of a range or its equivalent wins. For example,
iw;q=0.9,he;q=0.4producesiwandhe, both at weight0.9. ASCII spaces are removed throughout the input; tabs are not removed. Malformed ranges or invalid weights throwRangeError.