resolve-accept-language 1.0.38 → 1.0.39

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/locale.js CHANGED
@@ -10,12 +10,12 @@ var Locale = /** @class */ (function () {
10
10
  */
11
11
  function Locale(identifier) {
12
12
  if (!Locale.isLocale(identifier, false)) {
13
- throw new Error("invalid locale identifier '" + identifier + "'");
13
+ throw new Error("invalid locale identifier '".concat(identifier, "'"));
14
14
  }
15
15
  var _a = identifier.split('-'), languageCode = _a[0], countryCode = _a[1];
16
16
  this.languageCode = languageCode.toLowerCase();
17
17
  this.countryCode = countryCode.toUpperCase();
18
- this.identifier = this.languageCode + "-" + this.countryCode;
18
+ this.identifier = "".concat(this.languageCode, "-").concat(this.countryCode);
19
19
  }
20
20
  /**
21
21
  * Is a given string a locale identifier using the `language`-`country` format.
@@ -18,7 +18,7 @@ var LookupList = /** @class */ (function () {
18
18
  */
19
19
  LookupList.prototype.addLocale = function (quality, identifier) {
20
20
  if (!locale_1.default.isLocale(identifier)) {
21
- throw new Error("invalid locale identifier '" + identifier + "'");
21
+ throw new Error("invalid locale identifier '".concat(identifier, "'"));
22
22
  }
23
23
  if (!this.localesAndLanguagesByQuality[quality]) {
24
24
  this.localesAndLanguagesByQuality[quality] = new Set();
@@ -33,7 +33,7 @@ var LookupList = /** @class */ (function () {
33
33
  */
34
34
  LookupList.prototype.addLanguage = function (quality, languageCode) {
35
35
  if (!locale_1.default.isLanguageCode(languageCode)) {
36
- throw new Error("invalid ISO 639-1 alpha-2 language code '" + languageCode + "'");
36
+ throw new Error("invalid ISO 639-1 alpha-2 language code '".concat(languageCode, "'"));
37
37
  }
38
38
  if (!this.localesAndLanguagesByQuality[quality]) {
39
39
  this.localesAndLanguagesByQuality[quality] = new Set();
@@ -48,7 +48,7 @@ var LookupList = /** @class */ (function () {
48
48
  */
49
49
  LookupList.prototype.addUnsupportedLocaleLanguage = function (quality, languageCode) {
50
50
  if (!locale_1.default.isLanguageCode(languageCode)) {
51
- throw new Error("invalid ISO 639-1 alpha-2 language code '" + languageCode + "'");
51
+ throw new Error("invalid ISO 639-1 alpha-2 language code '".concat(languageCode, "'"));
52
52
  }
53
53
  if (!this.unsupportedLocaleLanguagesByQuality[quality]) {
54
54
  this.unsupportedLocaleLanguagesByQuality[quality] = new Set();
@@ -83,6 +83,6 @@ function getDirectiveDetails(directiveMatch) {
83
83
  var languageCode = matchedLanguageCode.toLowerCase();
84
84
  var countryCode = matchedCountryCode ? matchedCountryCode.toUpperCase() : undefined;
85
85
  var quality = matchedQuality === undefined ? '1' : parseFloat(matchedQuality).toString(); // Remove trailing zeros.
86
- var locale = countryCode ? languageCode + "-" + countryCode : undefined;
86
+ var locale = countryCode ? "".concat(languageCode, "-").concat(countryCode) : undefined;
87
87
  return { locale: locale, languageCode: languageCode, quality: quality };
88
88
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "resolve-accept-language",
3
- "version": "1.0.38",
3
+ "version": "1.0.39",
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": {
@@ -37,18 +37,18 @@
37
37
  ],
38
38
  "devDependencies": {
39
39
  "@release-it/conventional-changelog": "^3.3.0",
40
- "@types/jest": "^27.0.2",
41
- "@typescript-eslint/eslint-plugin": "^5.3.1",
42
- "@typescript-eslint/parser": "^5.3.1",
40
+ "@types/jest": "^27.0.3",
41
+ "@typescript-eslint/eslint-plugin": "^5.4.0",
42
+ "@typescript-eslint/parser": "^5.4.0",
43
43
  "dotenv-cli": "^4.1.0",
44
- "eslint": "^8.2.0",
44
+ "eslint": "^8.3.0",
45
45
  "eslint-config-prettier": "^8.3.0",
46
46
  "eslint-plugin-jest": "^25.2.4",
47
47
  "jest": "^27.3.1",
48
48
  "prettier": "2.4.1",
49
- "release-it": "^14.11.7",
49
+ "release-it": "^14.11.8",
50
50
  "ts-jest": "^27.0.7",
51
51
  "ts-node": "^10.4.0",
52
- "typescript": "^4.4.4"
52
+ "typescript": "^4.5.2"
53
53
  }
54
54
  }