resolve-accept-language 1.1.33 → 1.1.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/lookup-list.js +1 -1
- package/package.json +1 -1
package/lib/lookup-list.js
CHANGED
|
@@ -133,7 +133,7 @@ var LookupList = /** @class */ (function () {
|
|
|
133
133
|
* - Language tags that starts with a wildcard (e.g. "*-CA") should match the first supported locale of a country.
|
|
134
134
|
* - A quality value equivalent to "0", as per RFC 2616 (section 3.9), should be considered as "not acceptable".
|
|
135
135
|
*/
|
|
136
|
-
var directiveMatch = directiveString.match(/^((?<matchedLanguageCode>([a-z]{2}))(-(?<matchedCountryCode>[a-z]{2}))?)(;q=(?<matchedQuality>1|0
|
|
136
|
+
var directiveMatch = directiveString.match(/^((?<matchedLanguageCode>([a-z]{2}))(-(?<matchedCountryCode>[a-z]{2}))?)(;q=(?<matchedQuality>(1(\.0{0,3})?)|(0(\.\d{0,3})?)))?$/i);
|
|
137
137
|
if (!(directiveMatch === null || directiveMatch === void 0 ? void 0 : directiveMatch.groups))
|
|
138
138
|
return undefined; // No regular expression match.
|
|
139
139
|
var _a = directiveMatch.groups, matchedLanguageCode = _a.matchedLanguageCode, matchedCountryCode = _a.matchedCountryCode, matchedQuality = _a.matchedQuality;
|
package/package.json
CHANGED