warframe-worldstate-data 2.0.1 → 2.0.3
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/package.json +8 -4
- package/tools/translation.js +8 -5
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "warframe-worldstate-data",
|
3
|
-
"version": "2.0.
|
3
|
+
"version": "2.0.3",
|
4
4
|
"description": "Warframe data for use with warframe-worldstate-parser",
|
5
5
|
"main": "exports.js",
|
6
6
|
"type": "module",
|
@@ -19,7 +19,6 @@
|
|
19
19
|
"chai-json": "^1.0.0",
|
20
20
|
"chai-json-schema-ajv": "^5.2.4",
|
21
21
|
"coveralls": "^3.1.1",
|
22
|
-
"install-peerdeps": "^3.0.3",
|
23
22
|
"mocha": "^10.3.0",
|
24
23
|
"precommit-hook": "^3.0.0",
|
25
24
|
"sinon": "^17.0.1",
|
@@ -32,7 +31,7 @@
|
|
32
31
|
"coverage": "npm test && c8 report --reporter=text-lcov | coveralls",
|
33
32
|
"sort": "node tools/sort_languages.py",
|
34
33
|
"validate": "npm run lint:fix && npm run test && git add -u .",
|
35
|
-
"postinstall": "install-peerdeps @wfcd/eslint-config@^1.5.0 -S"
|
34
|
+
"postinstall": "npx -p install-peerdeps@latest install-peerdeps @wfcd/eslint-config@^1.5.0 -S | npx -p install-peerdeps@2.0.3 install-peerdeps @wfcd/eslint-config@^1.5.0 -S"
|
36
35
|
},
|
37
36
|
"repository": {
|
38
37
|
"type": "git",
|
@@ -116,5 +115,10 @@
|
|
116
115
|
"prettier": "@wfcd/eslint-config/prettier",
|
117
116
|
"pre-commit": [
|
118
117
|
"validate"
|
119
|
-
]
|
118
|
+
],
|
119
|
+
"overrides": {
|
120
|
+
"sinon-chai": {
|
121
|
+
"chai": "^5.0.3"
|
122
|
+
}
|
123
|
+
}
|
120
124
|
}
|
package/tools/translation.js
CHANGED
@@ -20,7 +20,7 @@ export const splitResourceName = (str) =>
|
|
20
20
|
.filter(Boolean)
|
21
21
|
.join(' ');
|
22
22
|
|
23
|
-
export const lastResourceName = (str) => (typeof str === 'string' ? str.split?.('/').
|
23
|
+
export const lastResourceName = (str) => (typeof str === 'string' ? str.split?.('/').reverse()[0] : str);
|
24
24
|
|
25
25
|
const i18n = (locale = 'en') => data[locale] || data;
|
26
26
|
|
@@ -73,8 +73,7 @@ export const languageString = (key, dataOverride = 'en') => {
|
|
73
73
|
return (
|
74
74
|
keyInData('languages', dataOverride)[lowerKey]?.value ??
|
75
75
|
keyInData('languages', dataOverride)[key]?.value ??
|
76
|
-
toTitleCase(splitResourceName(lastResourceName(String(key))))
|
77
|
-
key
|
76
|
+
(key ? toTitleCase(splitResourceName(lastResourceName(String(key)))) : key)
|
78
77
|
);
|
79
78
|
};
|
80
79
|
|
@@ -146,7 +145,7 @@ export const fissureTier = (key, dataOverride = 'en') => fissure(key, dataOverri
|
|
146
145
|
* @param {string} dataOverride locale for use with translation
|
147
146
|
* @returns {string} syndicate name
|
148
147
|
*/
|
149
|
-
export const syndicate = (key, dataOverride = 'en') => i18n(dataOverride).syndicates[key]?.
|
148
|
+
export const syndicate = (key, dataOverride = 'en') => i18n(dataOverride).syndicates[key]?.name ?? key;
|
150
149
|
|
151
150
|
/**
|
152
151
|
*
|
@@ -217,7 +216,11 @@ export const region = (key, dataOverride = 'en') => (key && i18n(dataOverride).p
|
|
217
216
|
* Retrieve conclave challenge name for the given key and locale
|
218
217
|
* @param {string} key key to retrieve
|
219
218
|
* @param {string} dataOverride locale key override
|
220
|
-
* @returns {
|
219
|
+
* @returns {{
|
220
|
+
* title: string,
|
221
|
+
* description: string,
|
222
|
+
* standing: number,
|
223
|
+
* }} - The conclave challenge name for the given key
|
221
224
|
*/
|
222
225
|
export const conclaveChallenge = (key, dataOverride = 'en') => {
|
223
226
|
const splitKey = lastResourceName(String(key));
|