ilib-localematcher 1.2.1 → 1.2.2

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.
@@ -0,0 +1 @@
1
+ {"type": "commonjs"}
package/package.json CHANGED
@@ -1,8 +1,14 @@
1
1
  {
2
2
  "name": "ilib-localematcher",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "main": "./lib/LocaleMatcher.js",
5
5
  "module": "./src/LocaleMatcher.js",
6
+ "exports": {
7
+ ".": {
8
+ "import": "./src/LocaleMatcher.js",
9
+ "require": "./lib/LocaleMatcher.js"
10
+ }
11
+ },
6
12
  "description": "A locale matcher to resolve partial locales or find fallback locales. iLib is a cross-engine library of internationalization (i18n) classes written in pure JS",
7
13
  "keywords": [
8
14
  "internationalization",
@@ -40,7 +46,6 @@
40
46
  "src",
41
47
  "lib",
42
48
  "docs",
43
- "locale",
44
49
  "README.md",
45
50
  "LICENSE"
46
51
  ],
@@ -53,14 +58,15 @@
53
58
  "build:prod": "grunt babel --mode=prod",
54
59
  "build:dev": "grunt babel --mode=dev",
55
60
  "build:test": "webpack-cli --config webpack-test.config.js",
61
+ "build:pkg": "echo '{\"type\": \"commonjs\"}' > lib/package.json",
56
62
  "build:data": "node scripts/genlikelyloc.js",
57
- "dist": "npm-run-all build:data doc doc:html build:prod; npm pack",
63
+ "dist": "npm-run-all build:data doc doc:html build:prod build:pkg; npm pack",
58
64
  "test": "npm run test:cli",
59
- "test:cli": "npm run build:dev ; node test/testSuite.js",
65
+ "test:cli": "LANG=en_US.UTF8 npm run build:dev ; bash test/testSuite.sh",
60
66
  "test:web": "npm run build:test ; open-cli ./test/testSuite.html ; open-cli ./test/testSuite.html -- firefox",
61
- "test:all": "LANG=en_US.UTF8 npm-run-all build:data test:cli test:web",
62
- "debug": "LANG=en_US.UTF8 npm run build:data ; npm run build:dev ; node --inspect-brk test/testSuite.js",
63
- "clean": "git clean -f -d *",
67
+ "test:all": "npm-run-all build:data test:cli test:web",
68
+ "debug": "LANG=en_US.UTF8 npm-run-all build:data build:dev ; node --inspect-brk test/testSuite.js",
69
+ "clean": "git clean -f -d src test; rm -rf lib/*",
64
70
  "doc": "mkdir -p docs ; jsdoc2md -c jsdoc.json --separators --source src/* -m table > docs/ilibLocaleMatcher.md",
65
71
  "doc:html": "jsdoc -c jsdoc.json"
66
72
  },
@@ -68,10 +74,11 @@
68
74
  "@babel/core": "^7.18.10",
69
75
  "@babel/preset-env": "^7.18.10",
70
76
  "@babel/register": "^7.18.9",
77
+ "@babel/runtime": "^7.18.9",
71
78
  "assertextras": "^1.1.0",
72
79
  "babel-loader": "^8.2.5",
73
80
  "babel-plugin-add-module-exports": "^1.0.4",
74
- "babel-plugin-uglify": "^1.0.2",
81
+ "babel-plugin-module-resolver": "^4.1.0",
75
82
  "cldr-core": "^41.0.0",
76
83
  "docdash": "^1.2.0",
77
84
  "grunt": "^1.5.3",
@@ -91,7 +98,7 @@
91
98
  "webpack-cli": "^4.10.0"
92
99
  },
93
100
  "dependencies": {
94
- "ilib-common": "^1.1.1",
95
- "ilib-locale": "^1.2.1"
101
+ "ilib-common": "^1.1.2",
102
+ "ilib-locale": "^1.2.2"
96
103
  }
97
104
  }
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * LocaleMatcher.js - Locale matcher definition
3
3
  *
4
- * Copyright © 2013-2015, 2018-2019, 2021 JEDLSoft
4
+ * Copyright © 2013-2015, 2018-2019, 2021-2022 JEDLSoft
5
5
  *
6
6
  * Licensed under the Apache License, Version 2.0 (the "License");
7
7
  * you may not use this file except in compliance with the License.
@@ -22,7 +22,7 @@
22
22
  import { Utils } from 'ilib-common';
23
23
  import Locale from 'ilib-locale';
24
24
 
25
- import matchdata from '../locale/localematch.json';
25
+ import { matchdata } from './localematch.js';
26
26
 
27
27
  const componentWeights = [
28
28
  0.5, // language
@@ -1,4 +1,24 @@
1
- {
1
+
2
+ /*
3
+ * localematch.js - Locale match mappings
4
+ *
5
+ * Copyright © 2022 JEDLSoft
6
+ *
7
+ * Licensed under the Apache License, Version 2.0 (the "License");
8
+ * you may not use this file except in compliance with the License.
9
+ * You may obtain a copy of the License at
10
+ *
11
+ * http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software
14
+ * distributed under the License is distributed on an "AS IS" BASIS,
15
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ *
17
+ * See the License for the specific language governing permissions and
18
+ * limitations under the License.
19
+ */
20
+
21
+ export const matchdata = {
2
22
  "likelyLocales": {
3
23
  "142": "zh-Hans-CN",
4
24
  "143": "uz-Latn-UZ",
@@ -8752,4 +8772,4 @@
8752
8772
  "uum-gag": 30,
8753
8773
  "uum-tr": 50
8754
8774
  }
8755
- }
8775
+ };
@@ -0,0 +1 @@
1
+ {"type": "module"}