resolve-accept-language 1.1.29 → 1.1.30
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.
|
@@ -26,7 +26,10 @@ var ResolveAcceptLanguage = /** @class */ (function () {
|
|
|
26
26
|
function ResolveAcceptLanguage(acceptLanguageHeader, locales) {
|
|
27
27
|
var lookupList = new lookup_list_1.default(acceptLanguageHeader, locales);
|
|
28
28
|
var topLocaleOrLanguage = lookupList.getTopLocaleOrLanguage();
|
|
29
|
-
if (topLocaleOrLanguage
|
|
29
|
+
if (topLocaleOrLanguage === undefined) {
|
|
30
|
+
this.relatedLocaleBasedMatch = lookupList.getTopRelatedLocale();
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
30
33
|
if (locale_1.default.isLocale(topLocaleOrLanguage)) {
|
|
31
34
|
this.localeBasedMatch = topLocaleOrLanguage;
|
|
32
35
|
}
|
|
@@ -34,9 +37,6 @@ var ResolveAcceptLanguage = /** @class */ (function () {
|
|
|
34
37
|
this.languageBasedMatch = lookupList.getTopByLanguage(topLocaleOrLanguage);
|
|
35
38
|
}
|
|
36
39
|
}
|
|
37
|
-
else {
|
|
38
|
-
this.relatedLocaleBasedMatch = lookupList.getTopRelatedLocale();
|
|
39
|
-
}
|
|
40
40
|
}
|
|
41
41
|
/**
|
|
42
42
|
* Is the best match language-based?
|
|
@@ -77,7 +77,7 @@ var ResolveAcceptLanguage = /** @class */ (function () {
|
|
|
77
77
|
* @returns True when a match is found, otherwise false.
|
|
78
78
|
*/
|
|
79
79
|
ResolveAcceptLanguage.prototype.hasMatch = function () {
|
|
80
|
-
return this.getBestMatch()
|
|
80
|
+
return this.getBestMatch() === undefined ? false : true;
|
|
81
81
|
};
|
|
82
82
|
/**
|
|
83
83
|
* Did the resolution of the preferred locale find no match?
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "resolve-accept-language",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.30",
|
|
4
4
|
"description": "Resolve the preferred locale based on the value of an `Accept-Language` HTTP header.",
|
|
5
5
|
"author": "Avansai (https://avansai.com)",
|
|
6
6
|
"repository": {
|
|
@@ -39,21 +39,21 @@
|
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@release-it/conventional-changelog": "^5.1.1",
|
|
41
41
|
"@types/jest": "^29.2.3",
|
|
42
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
43
|
-
"@typescript-eslint/parser": "^5.
|
|
42
|
+
"@typescript-eslint/eslint-plugin": "^5.45.0",
|
|
43
|
+
"@typescript-eslint/parser": "^5.45.0",
|
|
44
44
|
"dotenv-cli": "^6.0.0",
|
|
45
|
-
"eslint": "^8.
|
|
45
|
+
"eslint": "^8.28.0",
|
|
46
46
|
"eslint-config-prettier": "^8.5.0",
|
|
47
47
|
"eslint-import-resolver-node": "^0.3.6",
|
|
48
48
|
"eslint-import-resolver-typescript": "^3.5.2",
|
|
49
49
|
"eslint-plugin-import": "^2.26.0",
|
|
50
|
-
"eslint-plugin-jest": "^27.1.
|
|
50
|
+
"eslint-plugin-jest": "^27.1.6",
|
|
51
51
|
"eslint-plugin-prefer-arrow-functions": "^3.1.4",
|
|
52
52
|
"eslint-plugin-prettier": "^4.2.1",
|
|
53
|
-
"eslint-plugin-unicorn": "^
|
|
53
|
+
"eslint-plugin-unicorn": "^45.0.1",
|
|
54
54
|
"jest": "^29.3.1",
|
|
55
|
-
"prettier": "^2.
|
|
56
|
-
"prettier-plugin-organize-imports": "^3.2.
|
|
55
|
+
"prettier": "^2.8.0",
|
|
56
|
+
"prettier-plugin-organize-imports": "^3.2.1",
|
|
57
57
|
"prettier-plugin-sh": "^0.12.8",
|
|
58
58
|
"release-it": "^15.5.0",
|
|
59
59
|
"ts-jest": "^29.0.3",
|