warframe-worldstate-data 3.1.11 → 3.1.13

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 (260) hide show
  1. package/dist/tools/utilities.d.mts +10 -1
  2. package/dist/tools/utilities.mjs +15 -1
  3. package/package.json +2 -2
  4. package/.commitlintrc.mjs +0 -6
  5. package/.husky/commit-msg +0 -1
  6. package/.husky/pre-commit +0 -1
  7. package/.lintstagedrc.yml +0 -12
  8. package/.mocharc.yml +0 -7
  9. package/.nvmrc +0 -1
  10. package/.nycrc.json +0 -7
  11. package/babel.config.json +0 -4
  12. package/biome.json +0 -51
  13. package/data/arcanes.json +0 -461
  14. package/data/archonShards.json +0 -224
  15. package/data/conclaveData.json +0 -425
  16. package/data/cs/arcanes.json +0 -461
  17. package/data/cs/archonShards.json +0 -224
  18. package/data/cs/conclaveData.json +0 -425
  19. package/data/cs/eventsData.json +0 -27
  20. package/data/cs/factionsData.json +0 -32
  21. package/data/cs/fissureModifiers.json +0 -26
  22. package/data/cs/languages.json +0 -19595
  23. package/data/cs/missionTypes.json +0 -80
  24. package/data/cs/operationTypes.json +0 -6
  25. package/data/cs/persistentEnemyData.json +0 -21
  26. package/data/cs/solNodes.json +0 -2242
  27. package/data/cs/sortieData.json +0 -4253
  28. package/data/cs/steelPath.json +0 -114
  29. package/data/cs/syndicatesData.json +0 -86
  30. package/data/cs/synthTargets.json +0 -1262
  31. package/data/cs/tutorials.json +0 -17
  32. package/data/cs/upgradeTypes.json +0 -14
  33. package/data/de/arcanes.json +0 -461
  34. package/data/de/archonShards.json +0 -224
  35. package/data/de/conclaveData.json +0 -425
  36. package/data/de/eventsData.json +0 -27
  37. package/data/de/factionsData.json +0 -32
  38. package/data/de/fissureModifiers.json +0 -26
  39. package/data/de/languages.json +0 -19595
  40. package/data/de/missionTypes.json +0 -80
  41. package/data/de/operationTypes.json +0 -6
  42. package/data/de/persistentEnemyData.json +0 -21
  43. package/data/de/solNodes.json +0 -2242
  44. package/data/de/sortieData.json +0 -4253
  45. package/data/de/steelPath.json +0 -114
  46. package/data/de/syndicatesData.json +0 -86
  47. package/data/de/synthTargets.json +0 -1262
  48. package/data/de/tutorials.json +0 -17
  49. package/data/de/upgradeTypes.json +0 -14
  50. package/data/es/arcanes.json +0 -461
  51. package/data/es/archonShards.json +0 -224
  52. package/data/es/conclaveData.json +0 -425
  53. package/data/es/eventsData.json +0 -27
  54. package/data/es/factionsData.json +0 -32
  55. package/data/es/fissureModifiers.json +0 -26
  56. package/data/es/languages.json +0 -19595
  57. package/data/es/missionTypes.json +0 -80
  58. package/data/es/operationTypes.json +0 -6
  59. package/data/es/persistentEnemyData.json +0 -21
  60. package/data/es/solNodes.json +0 -2242
  61. package/data/es/sortieData.json +0 -4253
  62. package/data/es/steelPath.json +0 -114
  63. package/data/es/syndicatesData.json +0 -86
  64. package/data/es/synthTargets.json +0 -1262
  65. package/data/es/tutorials.json +0 -17
  66. package/data/es/upgradeTypes.json +0 -14
  67. package/data/eventsData.json +0 -27
  68. package/data/factionsData.json +0 -32
  69. package/data/fissureModifiers.json +0 -26
  70. package/data/fr/arcanes.json +0 -461
  71. package/data/fr/archonShards.json +0 -224
  72. package/data/fr/conclaveData.json +0 -425
  73. package/data/fr/eventsData.json +0 -27
  74. package/data/fr/factionsData.json +0 -32
  75. package/data/fr/fissureModifiers.json +0 -26
  76. package/data/fr/languages.json +0 -19595
  77. package/data/fr/missionTypes.json +0 -80
  78. package/data/fr/operationTypes.json +0 -6
  79. package/data/fr/persistentEnemyData.json +0 -21
  80. package/data/fr/solNodes.json +0 -2242
  81. package/data/fr/sortieData.json +0 -4253
  82. package/data/fr/steelPath.json +0 -114
  83. package/data/fr/syndicatesData.json +0 -86
  84. package/data/fr/synthTargets.json +0 -1262
  85. package/data/fr/tutorials.json +0 -17
  86. package/data/fr/upgradeTypes.json +0 -14
  87. package/data/index.html +0 -13
  88. package/data/it/arcanes.json +0 -461
  89. package/data/it/archonShards.json +0 -224
  90. package/data/it/conclaveData.json +0 -425
  91. package/data/it/eventsData.json +0 -27
  92. package/data/it/factionsData.json +0 -32
  93. package/data/it/fissureModifiers.json +0 -26
  94. package/data/it/languages.json +0 -19595
  95. package/data/it/missionTypes.json +0 -80
  96. package/data/it/operationTypes.json +0 -6
  97. package/data/it/persistentEnemyData.json +0 -21
  98. package/data/it/solNodes.json +0 -2242
  99. package/data/it/sortieData.json +0 -4253
  100. package/data/it/steelPath.json +0 -114
  101. package/data/it/syndicatesData.json +0 -86
  102. package/data/it/synthTargets.json +0 -1262
  103. package/data/it/tutorials.json +0 -17
  104. package/data/it/upgradeTypes.json +0 -14
  105. package/data/ko/arcanes.json +0 -461
  106. package/data/ko/archonShards.json +0 -224
  107. package/data/ko/conclaveData.json +0 -425
  108. package/data/ko/eventsData.json +0 -27
  109. package/data/ko/factionsData.json +0 -32
  110. package/data/ko/fissureModifiers.json +0 -26
  111. package/data/ko/languages.json +0 -19595
  112. package/data/ko/missionTypes.json +0 -80
  113. package/data/ko/operationTypes.json +0 -6
  114. package/data/ko/persistentEnemyData.json +0 -21
  115. package/data/ko/solNodes.json +0 -2242
  116. package/data/ko/sortieData.json +0 -4253
  117. package/data/ko/steelPath.json +0 -114
  118. package/data/ko/syndicatesData.json +0 -86
  119. package/data/ko/synthTargets.json +0 -1262
  120. package/data/ko/tutorials.json +0 -17
  121. package/data/ko/upgradeTypes.json +0 -14
  122. package/data/languages.json +0 -19595
  123. package/data/missionTypes.json +0 -80
  124. package/data/operationTypes.json +0 -6
  125. package/data/persistentEnemyData.json +0 -21
  126. package/data/pl/arcanes.json +0 -461
  127. package/data/pl/archonShards.json +0 -224
  128. package/data/pl/conclaveData.json +0 -425
  129. package/data/pl/eventsData.json +0 -27
  130. package/data/pl/factionsData.json +0 -32
  131. package/data/pl/fissureModifiers.json +0 -26
  132. package/data/pl/languages.json +0 -19595
  133. package/data/pl/missionTypes.json +0 -80
  134. package/data/pl/operationTypes.json +0 -6
  135. package/data/pl/persistentEnemyData.json +0 -21
  136. package/data/pl/solNodes.json +0 -2242
  137. package/data/pl/sortieData.json +0 -4253
  138. package/data/pl/steelPath.json +0 -114
  139. package/data/pl/syndicatesData.json +0 -86
  140. package/data/pl/synthTargets.json +0 -1262
  141. package/data/pl/tutorials.json +0 -17
  142. package/data/pl/upgradeTypes.json +0 -14
  143. package/data/pt/arcanes.json +0 -461
  144. package/data/pt/archonShards.json +0 -224
  145. package/data/pt/conclaveData.json +0 -425
  146. package/data/pt/eventsData.json +0 -27
  147. package/data/pt/factionsData.json +0 -32
  148. package/data/pt/fissureModifiers.json +0 -26
  149. package/data/pt/languages.json +0 -19595
  150. package/data/pt/missionTypes.json +0 -80
  151. package/data/pt/operationTypes.json +0 -6
  152. package/data/pt/persistentEnemyData.json +0 -21
  153. package/data/pt/solNodes.json +0 -2242
  154. package/data/pt/sortieData.json +0 -4253
  155. package/data/pt/steelPath.json +0 -114
  156. package/data/pt/syndicatesData.json +0 -86
  157. package/data/pt/synthTargets.json +0 -1262
  158. package/data/pt/tutorials.json +0 -17
  159. package/data/pt/upgradeTypes.json +0 -14
  160. package/data/ru/arcanes.json +0 -461
  161. package/data/ru/archonShards.json +0 -224
  162. package/data/ru/conclaveData.json +0 -425
  163. package/data/ru/eventsData.json +0 -27
  164. package/data/ru/factionsData.json +0 -32
  165. package/data/ru/fissureModifiers.json +0 -26
  166. package/data/ru/languages.json +0 -19595
  167. package/data/ru/missionTypes.json +0 -80
  168. package/data/ru/operationTypes.json +0 -6
  169. package/data/ru/persistentEnemyData.json +0 -21
  170. package/data/ru/solNodes.json +0 -2242
  171. package/data/ru/sortieData.json +0 -4253
  172. package/data/ru/steelPath.json +0 -114
  173. package/data/ru/syndicatesData.json +0 -86
  174. package/data/ru/synthTargets.json +0 -1262
  175. package/data/ru/tutorials.json +0 -17
  176. package/data/ru/upgradeTypes.json +0 -14
  177. package/data/solNodes.json +0 -2242
  178. package/data/sortieData.json +0 -4253
  179. package/data/sr/arcanes.json +0 -461
  180. package/data/sr/archonShards.json +0 -224
  181. package/data/sr/conclaveData.json +0 -425
  182. package/data/sr/eventsData.json +0 -27
  183. package/data/sr/factionsData.json +0 -32
  184. package/data/sr/fissureModifiers.json +0 -26
  185. package/data/sr/languages.json +0 -19595
  186. package/data/sr/missionTypes.json +0 -80
  187. package/data/sr/operationTypes.json +0 -6
  188. package/data/sr/persistentEnemyData.json +0 -21
  189. package/data/sr/solNodes.json +0 -2242
  190. package/data/sr/sortieData.json +0 -4253
  191. package/data/sr/steelPath.json +0 -114
  192. package/data/sr/syndicatesData.json +0 -86
  193. package/data/sr/synthTargets.json +0 -1262
  194. package/data/sr/tutorials.json +0 -17
  195. package/data/sr/upgradeTypes.json +0 -14
  196. package/data/steelPath.json +0 -33
  197. package/data/syndicatesData.json +0 -86
  198. package/data/synthTargets.json +0 -1262
  199. package/data/tr/arcanes.json +0 -461
  200. package/data/tr/archonShards.json +0 -224
  201. package/data/tr/conclaveData.json +0 -425
  202. package/data/tr/eventsData.json +0 -27
  203. package/data/tr/factionsData.json +0 -32
  204. package/data/tr/fissureModifiers.json +0 -26
  205. package/data/tr/languages.json +0 -19595
  206. package/data/tr/missionTypes.json +0 -80
  207. package/data/tr/operationTypes.json +0 -6
  208. package/data/tr/persistentEnemyData.json +0 -21
  209. package/data/tr/solNodes.json +0 -2242
  210. package/data/tr/sortieData.json +0 -4253
  211. package/data/tr/steelPath.json +0 -114
  212. package/data/tr/syndicatesData.json +0 -86
  213. package/data/tr/synthTargets.json +0 -1262
  214. package/data/tr/tutorials.json +0 -17
  215. package/data/tr/upgradeTypes.json +0 -14
  216. package/data/tutorials.json +0 -17
  217. package/data/uk/arcanes.json +0 -461
  218. package/data/uk/archonShards.json +0 -224
  219. package/data/uk/conclaveData.json +0 -425
  220. package/data/uk/eventsData.json +0 -27
  221. package/data/uk/factionsData.json +0 -32
  222. package/data/uk/fissureModifiers.json +0 -26
  223. package/data/uk/languages.json +0 -19595
  224. package/data/uk/missionTypes.json +0 -80
  225. package/data/uk/operationTypes.json +0 -6
  226. package/data/uk/persistentEnemyData.json +0 -21
  227. package/data/uk/solNodes.json +0 -2242
  228. package/data/uk/sortieData.json +0 -4253
  229. package/data/uk/steelPath.json +0 -114
  230. package/data/uk/syndicatesData.json +0 -86
  231. package/data/uk/synthTargets.json +0 -1262
  232. package/data/uk/tutorials.json +0 -17
  233. package/data/uk/upgradeTypes.json +0 -14
  234. package/data/upgradeTypes.json +0 -14
  235. package/data/zh/arcanes.json +0 -461
  236. package/data/zh/archonShards.json +0 -224
  237. package/data/zh/conclaveData.json +0 -425
  238. package/data/zh/eventsData.json +0 -27
  239. package/data/zh/factionsData.json +0 -32
  240. package/data/zh/fissureModifiers.json +0 -26
  241. package/data/zh/languages.json +0 -19595
  242. package/data/zh/missionTypes.json +0 -80
  243. package/data/zh/operationTypes.json +0 -6
  244. package/data/zh/persistentEnemyData.json +0 -21
  245. package/data/zh/solNodes.json +0 -2242
  246. package/data/zh/sortieData.json +0 -4253
  247. package/data/zh/steelPath.json +0 -114
  248. package/data/zh/syndicatesData.json +0 -86
  249. package/data/zh/synthTargets.json +0 -1262
  250. package/data/zh/tutorials.json +0 -17
  251. package/data/zh/upgradeTypes.json +0 -14
  252. package/exports.ts +0 -153
  253. package/safeImport.ts +0 -24
  254. package/tools/sortLanguages.ts +0 -44
  255. package/tools/timeDate.ts +0 -129
  256. package/tools/translation.ts +0 -430
  257. package/tools/utilities.ts +0 -4
  258. package/tsconfig.json +0 -13
  259. package/tsdown.config.ts +0 -15
  260. package/types.ts +0 -70
@@ -1,430 +0,0 @@
1
- import data, { WorldstateLangBundle, type Locale } from '../exports';
2
- import { ArchonShard, SolNode, Conclave, SteelPath } from '../types';
3
-
4
- /**
5
- * Rough Titlecase!
6
- * @param {string} str string to be titlecased
7
- * @returns {string} titlecased string
8
- */
9
- export const toTitleCase = (str: string): string => {
10
- return str.replace(/\w\S*/g, (txt) => txt.charAt(0).toUpperCase() + txt.substring(1).toLowerCase());
11
- };
12
-
13
- /**
14
- * Utility function to split the resource name and return somewhat human-readable string
15
- * @param {string} str localization resource key
16
- * @returns {string} human-readable string
17
- */
18
- export const splitResourceName = (str: string): string =>
19
- str
20
- .split(/([A-Z]?[^A-Z]*)/g)
21
- .filter(Boolean)
22
- .join(' ');
23
-
24
- export const lastResourceName = (str: string | undefined) => (str ? str.split?.('/').reverse()[0] : str);
25
-
26
- const i18n = (locale: Locale = 'en') => data[locale] || data;
27
-
28
- const keyInData = <T>(key: keyof WorldstateLangBundle, dataOverride?: Locale): T =>
29
- key in i18n(dataOverride) ? (i18n(dataOverride)[key] as T) : (key as T);
30
-
31
- /**
32
- *
33
- * @param {string} color - The internal color name
34
- * @param {string} dataOverride locale for use with translation
35
- * @returns {Object | undefined}
36
- */
37
- export const archonShard = (color: string, dataOverride: Locale = 'en') => {
38
- return keyInData<Record<string, ArchonShard>>('archonShards', dataOverride)[color] as ArchonShard;
39
- };
40
-
41
- /**
42
- *
43
- * @param {string} color - The internal color name
44
- * @param {string} dataOverride locale for use with translation
45
- * @returns {string}
46
- */
47
- export const archonShardColor = (color: string, dataOverride: Locale = 'en'): string =>
48
- archonShard(color, dataOverride)?.value ?? color;
49
-
50
- /**
51
- *
52
- * @param {string} color - The internal color name
53
- * @param {string} upgradeType - The upgrade type
54
- * @param {string} dataOverride locale for use with translation
55
- * @returns {string}
56
- */
57
- export const archonShardUpgradeType = (color: string, upgradeType: string, dataOverride: Locale = 'en'): string =>
58
- archonShard(color, dataOverride)?.upgradeTypes[upgradeType]?.value ?? lastResourceName(upgradeType);
59
-
60
- /**
61
- *
62
- * @param {string} key - The data key
63
- * @param {string} dataOverride locale for use with translation
64
- * @returns {string} faction name
65
- */
66
- export const faction = (key: string, dataOverride: Locale = 'en'): string =>
67
- keyInData<Record<string, { value: string }>>('factions', dataOverride)[key]?.value ?? key;
68
-
69
- const solNode = (key: string, thing: keyof SolNode, dataOverride: Locale = 'en') =>
70
- keyInData<Record<string, SolNode>>('solNodes', dataOverride)?.[key]?.[thing] ?? lastResourceName(key) ?? key;
71
-
72
- /**
73
- *
74
- * @param {string} key - The data key
75
- * @param {string} dataOverride locale for use with translation
76
- * @returns {string} node name
77
- */
78
- export const node = (key: string, dataOverride: Locale = 'en'): string => solNode(key, 'value', dataOverride);
79
-
80
- /**
81
- *
82
- * @param {string} key - The data key
83
- * @param {string} dataOverride locale for use with translation
84
- * @returns {string} mission type of the node
85
- */
86
- export const nodeMissionType = (key: string, dataOverride: Locale = 'en'): string => solNode(key, 'type', dataOverride);
87
- /**
88
- *
89
- * @param {string} key - The data key
90
- * @param {string} dataOverride locale for use with translation
91
- * @returns {string} faction that controls the node
92
- */
93
- export const nodeEnemy = (key: string, dataOverride: Locale = 'en'): string => {
94
- return key in i18n(dataOverride).solNodes ? i18n(dataOverride).solNodes[key].enemy : (lastResourceName(key) ?? key);
95
- };
96
-
97
- /**
98
- *
99
- * @param {string} key - The data key
100
- * @param {string} dataOverride locale for use with translation
101
- * @returns {string} localization for language string
102
- */
103
- export const languageString = (key: string, dataOverride: Locale = 'en'): string => {
104
- const lowerKey: string = String(key).toLowerCase();
105
- return (
106
- i18n(dataOverride).languages[lowerKey]?.value ??
107
- i18n(dataOverride).languages[key]?.value ??
108
- (key ? toTitleCase(splitResourceName(lastResourceName(String(key)) ?? '')) : key)
109
- );
110
- };
111
-
112
- /**
113
- *
114
- * @param {string} key - The data key
115
- * @param {string} dataOverride locale for use with translation
116
- * @returns {string} localization for language description
117
- */
118
- export const languageDesc = (key: string, dataOverride: Locale = 'en'): string => {
119
- const lowerKey = String(key).toLowerCase();
120
- return (
121
- i18n(dataOverride).languages[lowerKey]?.desc ??
122
- i18n(dataOverride).languages[key]?.desc ??
123
- (key ? `[PH] ${toTitleCase(splitResourceName(lastResourceName(String(key)) ?? ''))} Desc` : key)
124
- );
125
- };
126
-
127
- /**
128
- *
129
- * @param {string} key - The data key
130
- * @param {string} dataOverride locale for use with translation
131
- * @returns {string} translation for mission type
132
- */
133
- export const missionType = (key: string, dataOverride: Locale = 'en'): string => {
134
- const keyBased = key && typeof key === 'string' && toTitleCase((key ?? '').replace(/^MT_/, ''));
135
- return key in i18n(dataOverride).missionTypes ? i18n(dataOverride).missionTypes[key].value : (keyBased as string);
136
- };
137
-
138
- const conclave = (key: string, thing: keyof Conclave, dataOverride: Locale = 'en') =>
139
- keyInData<Conclave>('conclave', dataOverride)?.[thing]?.[key];
140
-
141
- /**
142
- *
143
- * @param {string} key - The data key
144
- * @param {string} dataOverride locale for use with translation
145
- * @returns {string} conclave mode
146
- */
147
- export const conclaveMode = (key: string, dataOverride: Locale = 'en'): string =>
148
- (conclave(key, 'modes', dataOverride) as { value: string })?.value ?? key;
149
-
150
- /**
151
- *
152
- * @param {string} key - The data key
153
- * @param {string} dataOverride locale for use with translation
154
- * @returns {{ value: string; description: string }} conclave category
155
- */
156
- export const conclaveCategory = (key: string, dataOverride: Locale = 'en'): string =>
157
- (conclave(key, 'categories', dataOverride) as { value: string; description: string })?.value ?? key;
158
-
159
- const fissure = (key: string, dataOverride: Locale = 'en') =>
160
- keyInData<Record<string, { value: string; num: number }>>('fissureModifiers', dataOverride)?.[key] ?? key;
161
-
162
- /**
163
- *
164
- * @param {string} key - The data key
165
- * @param {string} dataOverride locale for use with translation
166
- * @returns {string} fissure modifier data
167
- */
168
- export const fissureModifier = (key: string, dataOverride: Locale = 'en'): string =>
169
- fissure(key, dataOverride)?.value ?? key;
170
-
171
- /**
172
- *
173
- * @param {string} key - The data key
174
- * @param {string} dataOverride locale for use with translation
175
- * @returns {number | string} fissure tier
176
- */
177
- export const fissureTier = (key: string, dataOverride: Locale = 'en'): number | string =>
178
- fissure(key, dataOverride).num ?? key;
179
-
180
- /**
181
- *
182
- * @param {string} key - The data key
183
- * @param {string} dataOverride locale for use with translation
184
- * @returns {string} syndicate name
185
- */
186
- export const syndicate = (key: string, dataOverride: Locale = 'en'): string =>
187
- i18n(dataOverride).syndicates[key]?.name ?? key;
188
-
189
- /**
190
- *
191
- * @param {string} key - The data key
192
- * @param {string} dataOverride locale for use with translation
193
- * @returns {string} upgrade type
194
- */
195
- export const upgrade = (key: string, dataOverride: Locale = 'en'): string =>
196
- i18n(dataOverride).upgradeTypes[key]?.value ?? key;
197
-
198
- const oppo = (key: string, dataOverride: Locale = 'en') => i18n(dataOverride).operationTypes[key];
199
-
200
- /**
201
- *
202
- * @param {string} key - The data key
203
- * @param {string} dataOverride locale for use with translation
204
- * @returns {string} mathematical operation value
205
- */
206
- export const operation = (key: string, dataOverride: Locale = 'en'): string => oppo(key, dataOverride)?.value ?? key;
207
-
208
- /**
209
- *
210
- * @param {string} key - The data key
211
- * @param {string} dataOverride locale for use with translation
212
- * @returns {string} symbol of mathematical operation
213
- */
214
- export const operationSymbol = (key: string, dataOverride: Locale = 'en'): string =>
215
- oppo(key, dataOverride)?.symbol ?? key;
216
-
217
- const sortie = (key: string, dataOverride: Locale = 'en') => i18n(dataOverride).sortie.bosses[key];
218
-
219
- /**
220
- * @param {string} key - The data key
221
- * @param {string} dataOverride locale for use with translation
222
- * @returns {string} sortie boss name
223
- */
224
- export const sortieBoss = (key: string, dataOverride: Locale = 'en'): string => sortie(key, dataOverride)?.name ?? key;
225
-
226
- /**
227
- * @param {string} key - The data key
228
- * @param {string} dataOverride locale for use with translation
229
- * @returns {string} faction for a sortie based on the boss
230
- */
231
- export const sortieFaction = (key: string, dataOverride: Locale = 'en'): string =>
232
- sortie(key, dataOverride)?.faction ?? key;
233
-
234
- /**
235
- *
236
- * @param {string} key - The data key
237
- * @param {string} dataOverride locale for use with translation
238
- * @returns {string} sortie modifier data
239
- */
240
- export const sortieModifier = (key: string, dataOverride: Locale = 'en'): string =>
241
- i18n(dataOverride).sortie.modifierTypes?.[key] ?? key;
242
-
243
- /**
244
- * @param {string} key - The data key
245
- * @param {string} dataOverride locale for use with translation
246
- * @returns {string} sortie modifier description
247
- */
248
- export const sortieModDesc = (key: string, dataOverride: Locale = 'en'): string =>
249
- i18n(dataOverride).sortie.modifierDescriptions?.[key] ?? key;
250
-
251
- /**
252
- * Retrieve the localized region for a given key
253
- * @param {string | number} key - The region key
254
- * @param {string} dataOverride - The locale to use for translations
255
- * @returns {string} localized region name
256
- */
257
- export const region = (key: number, dataOverride: Locale = 'en'): string | number =>
258
- (key && i18n(dataOverride).persistentEnemy?.regions[key]) ?? key;
259
-
260
- /**
261
- * Retrieve conclave challenge name for the given key and locale
262
- * @param {string} key key to retrieve
263
- * @param {string} dataOverride locale key override
264
- * @returns {{
265
- * title: string,
266
- * description: string,
267
- * standing: number,
268
- * }} - The conclave challenge name for the given key
269
- */
270
- export const conclaveChallenge = (
271
- key: string,
272
- dataOverride: Locale = 'en'
273
- ): {
274
- title: string;
275
- description: string;
276
- standing: number;
277
- } => {
278
- const splitKey = lastResourceName(String(key))!;
279
-
280
- if (splitKey !== undefined && i18n(dataOverride).conclave?.challenges?.[splitKey]) {
281
- return i18n(dataOverride).conclave.challenges[splitKey];
282
- }
283
- return {
284
- title: toTitleCase(splitResourceName(splitKey)),
285
- description: toTitleCase(splitResourceName(splitKey)),
286
- standing: 0,
287
- };
288
- };
289
-
290
- /**
291
- * Get the steel path data for given key
292
- * @param {string} dataOverride - The locale to use for translations
293
- * @returns {string} - The steel path data for the given key
294
- */
295
- export const steelPath = (dataOverride: Locale = 'en'): SteelPath =>
296
- (i18n(dataOverride) || /* istanbul ignore next */ data).steelPath;
297
-
298
- const valMapping = (key: string, map: Record<string, string>) => {
299
- let val = 'None';
300
- Object.keys(map).forEach((k) => {
301
- if (key.includes(k)) {
302
- val = map[k];
303
- }
304
- });
305
- return val;
306
- };
307
-
308
- const focusMap = {
309
- 'Focus/Attack': 'Madurai',
310
- 'Focus/Defense': 'Vazarin',
311
- 'Focus/Tactic': 'Naramon',
312
- 'Focus/Power': 'Zenurik',
313
- 'Focus/Ward': 'Unairu',
314
- };
315
- /**
316
- * Translate the given focus school
317
- * @param {string} focus The focus school to translate
318
- * @returns {string} The translated focus school
319
- */
320
- export const translateFocus = (focus: string = ''): string => valMapping(focus, focusMap);
321
-
322
- const polarityMap = {
323
- AP_ATTACK: 'Madurai',
324
- AP_DEFENSE: 'Vazarin',
325
- AP_TACTIC: 'Naramon',
326
- AP_POWER: 'Zenurik',
327
- AP_WARD: 'Unairu',
328
- AP_UMBRA: 'Umbra',
329
- AP_ANY: 'Aura',
330
- };
331
-
332
- /**
333
- * Translate the given polarity
334
- * @param {string?} pol The polarity to translate
335
- * @returns {string} The translated polarity
336
- */
337
- export const translatePolarity = (pol: string = ''): string => valMapping(pol, polarityMap);
338
-
339
- const eventTypeMap = {
340
- CET_CHALLENGE: 'To Do',
341
- CET_UPGRADE: 'Override',
342
- CET_REWARD: 'Big Prize!',
343
- CET_PLOT: 'Birthday',
344
- };
345
-
346
- /**
347
- * Translate the given event key
348
- * @param {string} key Unique event type
349
- * @returns {string}
350
- */
351
- export const translateCalendarEvent = (key: string): string => valMapping(key, eventTypeMap);
352
-
353
- /**
354
- * Translate the given season name to a non-unique string
355
- * @param {string} season Unique season name
356
- * @returns {string}
357
- */
358
- export const translateSeason = (season: string): string => toTitleCase(season.replace('CST_', ''));
359
-
360
- const archimedeaTypes = {
361
- CT_LAB: "Deep Archimedea",
362
- CT_HEX: "Temporal Archimedea"
363
- }
364
-
365
- export const translateArchimedeaType = (type: string) => valMapping(type, archimedeaTypes);
366
-
367
- /**
368
- * An object containing functions to convert in-game names to their localizations
369
- * @typedef {Record<string, function>} Translator
370
- * @property {function} faction - Converts faction names
371
- * @property {function} node - Converts star map node names
372
- * @property {function} nodeMissionType - Returns the mission type of given node
373
- * @property {function} nodeEnemy - Returns the faction that controls a given node
374
- * @property {function} languageString - Converts generic language strings
375
- * @property {function} languageDesc - Converts generic language strings
376
- * and retrieves the description
377
- * @property {function} missionType - Converts mission types
378
- * @property {function} conclaveMode - Converts conclave modes
379
- * @property {function} conclaveCategory - Converts conclave challenge categories
380
- * @property {function} fissureModifier - Converts fissure mission modifiers
381
- * @property {function} syndicate - Converts syndicate names
382
- * @property {function} upgrade - Converts upgrade types
383
- * @property {function} operation - Converts operation types
384
- * @property {function} sortieBoss - Converts sortie boss names
385
- * @property {function} sortieModifier - Converts sortie modifier types
386
- * @property {function} sortieModDesc - Converts sortie modifier type descriptions
387
- * @property {function} region - Converts persistent enemy region indicies
388
- * @property {function} conclaveChallenge - Convert conclave identifiers into standing data
389
- * @property {function} steelPath - Retrieve Steel Path rotation data for locale
390
- * @property {function} toTitleCase - Format provided string as titlecase
391
- * @property {function} translateFocus - Translate focus schools
392
- * @property {function} translatePolarity - Translate polarities
393
- * @property {function} archonShard - Converts archon shard names
394
- * @property {function} archonShardColor - Converts archon shard names to in-game color values
395
- * @property {function} archonShardUpgradeType - Convert archon shard upgrade type
396
- * @property {function} translateCalendarEvent - Translate the given event key
397
- * @property {function} translateSeason - Translate the given season name to a non-unique string
398
- */
399
- export default {
400
- faction,
401
- node,
402
- nodeMissionType,
403
- nodeEnemy,
404
- languageString,
405
- languageDesc,
406
- missionType,
407
- conclaveMode,
408
- conclaveCategory,
409
- fissureModifier,
410
- fissureTier,
411
- syndicate,
412
- upgrade,
413
- operation,
414
- operationSymbol,
415
- sortieBoss,
416
- sortieModifier,
417
- sortieModDesc,
418
- sortieFaction,
419
- region,
420
- conclaveChallenge,
421
- steelPath,
422
- toTitleCase,
423
- translateFocus,
424
- translatePolarity,
425
- archonShard,
426
- archonShardColor,
427
- archonShardUpgradeType,
428
- translateCalendarEvent,
429
- translateSeason,
430
- };
@@ -1,4 +0,0 @@
1
- /* istanbul ignore file */
2
-
3
- export * from './timeDate';
4
- export * from './translation';
package/tsconfig.json DELETED
@@ -1,13 +0,0 @@
1
- {
2
- "exclude": [
3
- "node_modules"
4
- ],
5
- "compilerOptions": {
6
- "module": "esnext",
7
- "target": "es2024", // set to the *lowest* target you support
8
- "strict": true,
9
- "moduleResolution": "bundler",
10
- "esModuleInterop": true,
11
- "isolatedModules": true,
12
- }
13
- }
package/tsdown.config.ts DELETED
@@ -1,15 +0,0 @@
1
- import { defineConfig } from 'tsdown';
2
-
3
- export default defineConfig({
4
- entry: [
5
- 'exports.ts',
6
- 'safeImport.ts',
7
- 'types.ts',
8
- './tools/timeDate.ts',
9
- './tools/translation.ts',
10
- './tools/utilities.ts',
11
- ],
12
- copy: ['./data'],
13
- dts: true,
14
- format: 'esm',
15
- });
package/types.ts DELETED
@@ -1,70 +0,0 @@
1
- export interface Arcane {
2
- regex: string;
3
- name: string;
4
- effect: string;
5
- rarity: string;
6
- location: string;
7
- thumbnail: string;
8
- }
9
-
10
- export interface ArchonShard {
11
- value: string;
12
- upgradeTypes: Record<string, { value: string }>;
13
- }
14
-
15
- export interface Conclave {
16
- modes: Record<string, { value: string }>;
17
- categories: Record<string, { value: string; description: string }>;
18
- challenges: Record<string, { title: string; description: string; standing: number }>;
19
- affectors: Record<string, { title: string; description: string; standing: number }>;
20
- }
21
-
22
- export interface Events {
23
- tags: Record<string, { value: string }>;
24
- scoreVariables: Record<string, { value: { value: string } }>;
25
- scoreMaxTags: Record<string, { value: { value: string } }>;
26
- }
27
-
28
- export interface SteelPath {
29
- rotation: SteelPathOffering[];
30
- evergreen: SteelPathOffering[];
31
- }
32
-
33
- export interface SteelPathOffering {
34
- name: string;
35
- cost: number;
36
- }
37
-
38
- export interface SynthesisTarget {
39
- name: string;
40
- locations: SynthesisTargetLocation[];
41
- }
42
-
43
- interface SynthesisTargetLocation {
44
- last_verified: string;
45
- level: string;
46
- spawn_rate: string;
47
- mission: string;
48
- planet: string;
49
- type: string;
50
- faction: string;
51
- }
52
-
53
- export interface SolNode {
54
- value: string;
55
- enemy: string;
56
- type: string;
57
- }
58
-
59
- interface SortieEndState {
60
- bossName: string;
61
- regions: { name: string; missions: string[] }[];
62
- }
63
-
64
- export interface SortieData {
65
- modifierTypes: Record<string, string>;
66
- modifierDescriptions: Record<string, string>;
67
- bosses: Record<string, { name: string; faction: string }>;
68
- endStates: SortieEndState[];
69
- modifiers: string[];
70
- }