resolve-accept-language 1.1.52 → 1.1.54

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.
Files changed (2) hide show
  1. package/README.md +1 -6
  2. package/package.json +7 -7
package/README.md CHANGED
@@ -69,22 +69,17 @@ if (resolveAcceptLanguage.hasNoMatch()) {
69
69
 
70
70
  ## How does the resolver work?
71
71
 
72
- As per RFC 4647, this package uses the "lookup" matching scheme. This means that it will always produce exactly one match for a
73
- given request.
72
+ As per RFC 4647, this package uses the "lookup" matching scheme. This means that it will always produce exactly one match for a given request.
74
73
 
75
74
  The matching strategy will use the following logic:
76
75
 
77
76
  1. The default locale (when provided) will always be put as the first locale being evaluated since it is considered the highest quality content available. Otherwise, the locales will be evaluated in the order provided, where the first is the highest quality and the last the lowest.
78
77
  2. All locales and languages are extracted from the HTTP header and sorted by quality factor. Locales and languages that are in the HTTP header but not in scope are discarded.
79
78
  3. Three different matching patterns (based on the HTTP header's quality factor and order of the provided locales):
80
-
81
79
  1. If there were any matches, get the highest-ranked (quality factor) locale or language code:
82
-
83
80
  1. **Locale-based match**: Is the highest-ranked a locale? If yes, this is the best match.
84
81
  2. **Language-based match**: Otherwise, find the first locale that matches the highest-ranked language.
85
-
86
82
  2. **Related-locale-based match**: If there is no match, find the first locale with a language that matches the highest-ranked language of locales that were not in scope. This is a bit of a "fuzzy match", but the presumption is that it's better to show content in a language that can be understood even if the country is wrong.
87
-
88
83
  4. When using `resolveAcceptLanguage` return the default locale as a last resort option.
89
84
 
90
85
  ## Why another `Accept-Language` package?
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "resolve-accept-language",
3
- "version": "1.1.52",
3
+ "version": "1.1.54",
4
4
  "description": "Resolve the preferred locale based on the value of an `Accept-Language` HTTP header.",
5
5
  "keywords": [
6
6
  "accept-language",
@@ -39,25 +39,25 @@
39
39
  "devDependencies": {
40
40
  "@release-it/conventional-changelog": "5.1.1",
41
41
  "@types/jest": "29.5.1",
42
- "@typescript-eslint/eslint-plugin": "5.59.0",
43
- "@typescript-eslint/parser": "5.59.0",
42
+ "@typescript-eslint/eslint-plugin": "5.59.2",
43
+ "@typescript-eslint/parser": "5.59.2",
44
44
  "dotenv-cli": "7.2.1",
45
- "eslint": "8.39.0",
45
+ "eslint": "8.40.0",
46
46
  "eslint-config-prettier": "8.8.0",
47
47
  "eslint-import-resolver-node": "0.3.7",
48
48
  "eslint-import-resolver-typescript": "3.5.5",
49
49
  "eslint-plugin-import": "2.27.5",
50
50
  "eslint-plugin-jest": "27.2.1",
51
- "eslint-plugin-json-files": "2.1.0",
51
+ "eslint-plugin-json-files": "2.2.0",
52
52
  "eslint-plugin-prefer-arrow-functions": "3.1.4",
53
53
  "eslint-plugin-prettier": "4.2.1",
54
54
  "eslint-plugin-tsdoc": "0.2.17",
55
- "eslint-plugin-unicorn": "46.0.0",
55
+ "eslint-plugin-unicorn": "47.0.0",
56
56
  "jest": "29.5.0",
57
57
  "prettier": "2.8.8",
58
58
  "prettier-plugin-organize-imports": "3.2.2",
59
59
  "prettier-plugin-sh": "0.12.8",
60
- "release-it": "15.10.1",
60
+ "release-it": "15.10.3",
61
61
  "ts-jest": "29.1.0",
62
62
  "ts-node": "10.9.1",
63
63
  "typescript": "5.0.4"