@trenskow/language 1.2.13 → 1.3.0

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.
@@ -5,17 +5,17 @@
5
5
  "version": "0.2.0",
6
6
  "configurations": [
7
7
  {
8
- "type": "pwa-node",
9
- "request": "launch",
10
8
  "name": "Launch Program",
11
- "skipFiles": [
12
- "<node_internals>/**"
13
- ],
14
9
  "program": "${workspaceFolder}/node_modules/mocha/bin/mocha",
15
10
  "args": [
16
11
  "${workspaceFolder}/test",
17
12
  "--bail"
18
- ]
13
+ ],
14
+ "request": "launch",
15
+ "skipFiles": [
16
+ "<node_internals>/**"
17
+ ],
18
+ "type": "node"
19
19
  }
20
20
  ]
21
21
  }
package/index.js CHANGED
@@ -159,7 +159,7 @@ exports.match = match;
159
159
  Object.defineProperty(exports, 'all', {
160
160
  get: () => {
161
161
  return [].concat(...Object.keys(languages).map((language) => {
162
- return [].concat(...Object.keys(languages[language].scripts).map((script) => {
162
+ return [].concat(...Object.keys(languages[language].scripts || {}).map((script) => {
163
163
  return [].concat(...languages[language].scripts[script].countries.map((country) => {
164
164
  let result = [`${language}-${script}-${country}`];
165
165
  if (Object.keys(languages[language].scripts).length == 1) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trenskow/language",
3
- "version": "1.2.13",
3
+ "version": "1.3.0",
4
4
  "description": "A small library for getting a full language identifier (RFC 5646).",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -22,6 +22,6 @@
22
22
  "mocha": "^10.2.0"
23
23
  },
24
24
  "dependencies": {
25
- "@trenskow/localization-data": "^1.2.5"
25
+ "@trenskow/localization-data": "^1.3.0"
26
26
  }
27
27
  }
package/test/index.js CHANGED
@@ -8,7 +8,7 @@ const
8
8
 
9
9
  describe('language', () => {
10
10
  it ('should come back with all.', () => {
11
- expect(language.all).to.be.an('array').lengthOf(723);
11
+ expect(language.all).to.be.an('array').lengthOf(747);
12
12
  });
13
13
  it ('should come back with `da-Latn-DK`.', () => {
14
14
  expect(language.expand('da')).to.equal('da-Latn-DK');