@trenskow/language 1.2.2 → 1.2.5

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 +8 -9
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -27,23 +27,23 @@ Takes a (partially) full RFC 5646 string and reduces it to its minimum value.
27
27
  ### Example
28
28
 
29
29
  ```javascript
30
- collapse('da-Latn-DK'); // Returns 'da'
31
- collapse('da-DK') // Returns 'da'
32
- collapse('en-US') // Returns 'en-US'
30
+ collapse('da-Latn-DK'); // -> 'da'
31
+ collapse('da-DK') // -> 'da'
32
+ collapse('en-US') // -> 'en-US'
33
33
  ```
34
34
 
35
35
  ## `match(identifier, supported, [default])`
36
36
 
37
- Takes an HTTP `Accept-Header` value value and returns the language to use based on an array of supported languages.
37
+ Takes an HTTP `Accept-Header` value and returns the language to use based on an array of supported languages.
38
38
 
39
39
  > If `default` is omitted the first supported language becomes the default.
40
40
 
41
41
  ### Example
42
42
 
43
43
  ```javascript
44
- match('da, en-US; en-GB;q=0.8, en', ['da', 'en-US'], 'en-US'); // Returns 'da'
45
- match('en-GB;q=0.8, en', ['en-US', 'da-DK']); // returns 'en-US'
46
- match('de-DE', ['da-DK', 'en-US'], 'en-US'); // Returns 'en-US'
44
+ match('da, en-US; en-GB;q=0.8, en', ['da', 'en-US'], 'en-US'); // -> 'da'
45
+ match('en-GB;q=0.8, en', ['en-US', 'da-DK']); // -> 'en-US'
46
+ match('de-DE', ['da-DK', 'en-US'], 'en-US'); // -> 'en-US'
47
47
  ```
48
48
 
49
49
  ## `all`
@@ -53,8 +53,7 @@ Returns all posible identifier combinations.
53
53
  ### Example
54
54
 
55
55
  ```javascript
56
- all /*
57
- [
56
+ all /* -> [
58
57
  'af-Latn-NA', 'af-NA', 'af-Latn-ZA', 'af-ZA', 'am-Ethi-ET',
59
58
  'am-ET', 'am', 'ar-Arab-AE', 'ar-Arab-BH', 'ar-Arab-DJ',
60
59
  'ar-Arab-DZ', 'ar-Arab-EG', 'ar-Arab-EH', 'ar-Arab-ER', 'ar-Arab-IL',
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@trenskow/language",
3
- "version": "1.2.2",
3
+ "version": "1.2.5",
4
4
  "description": "A small library for getting a full language identifier (RFC 5646).",
5
5
  "main": "index.js",
6
6
  "scripts": {
7
- "test": "./node_modules/mocha/bin/mocha test/index.js"
7
+ "test": "./node_modules/mocha/bin/mocha.js test/index.js"
8
8
  },
9
9
  "repository": {
10
10
  "type": "git",
@@ -19,7 +19,7 @@
19
19
  "devDependencies": {
20
20
  "chai": "^4.3.6",
21
21
  "eslint": "^8.13.0",
22
- "mocha": "^9.2.2"
22
+ "mocha": "^10.0.0"
23
23
  },
24
24
  "dependencies": {
25
25
  "@trenskow/localization-data": "^1.2.1"