warframe-worldstate-data 3.1.10 → 3.1.12

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/.nycrc.json ADDED
@@ -0,0 +1,7 @@
1
+ {
2
+ "extends": "@istanbuljs/nyc-config-typescript",
3
+ "exclude": ["test/**"],
4
+ "reporter": ["lcov", "text", "html"],
5
+ "skip-full": true,
6
+ "all": true
7
+ }
package/biome.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "https://biomejs.dev/schemas/2.2.2/schema.json",
2
+ "$schema": "https://biomejs.dev/schemas/2.3.6/schema.json",
3
3
  "vcs": {
4
4
  "enabled": false,
5
5
  "clientKind": "git",
@@ -1,4 +1,4 @@
1
- import { a as SolNode, i as Events, l as SynthesisTarget, n as ArchonShard, o as SortieData, r as Conclave, s as SteelPath, t as Arcane } from "./types-3hUBzsIn.mjs";
1
+ import { a as SolNode, i as Events, l as SynthesisTarget, n as ArchonShard, o as SortieData, r as Conclave, s as SteelPath, t as Arcane } from "./types-BambsMUW.mjs";
2
2
 
3
3
  //#region exports.d.ts
4
4
  type Locale = 'de' | 'en' | 'es' | 'fr' | 'it' | 'ko' | 'pl' | 'pt' | 'ru' | 'zh' | 'cs' | 'sr' | 'uk';
@@ -0,0 +1,78 @@
1
+ import { t as safeImport } from "./safeImport-CE5wf6im.mjs";
2
+
3
+ //#region exports.ts
4
+ const locales = [
5
+ "de",
6
+ "es",
7
+ "fr",
8
+ "it",
9
+ "ko",
10
+ "pl",
11
+ "pt",
12
+ "ru",
13
+ "zh",
14
+ "cs",
15
+ "sr",
16
+ "uk"
17
+ ];
18
+ const makeBundle = async () => {
19
+ /**
20
+ * English United States translations bundle,
21
+ * default translations
22
+ * @type {WorldstateLangBundle}
23
+ */
24
+ const enUS = {
25
+ arcanes: await safeImport("./data/arcanes.json"),
26
+ archonShards: await safeImport("./data/archonShards.json"),
27
+ conclave: await safeImport("./data/conclaveData.json"),
28
+ events: await safeImport("./data/eventsData.json"),
29
+ factions: await safeImport("./data/factionsData.json"),
30
+ fissureModifiers: await safeImport("./data/fissureModifiers.json"),
31
+ languages: await safeImport("./data/languages.json"),
32
+ missionTypes: await safeImport("./data/missionTypes.json"),
33
+ operationTypes: await safeImport("./data/operationTypes.json"),
34
+ persistentEnemy: await safeImport("./data/persistentEnemyData.json"),
35
+ solNodes: await safeImport("./data/solNodes.json"),
36
+ sortie: await safeImport("./data/sortieData.json"),
37
+ syndicates: await safeImport("./data/syndicatesData.json"),
38
+ tutorials: await safeImport("./data/tutorials.json"),
39
+ upgradeTypes: await safeImport("./data/upgradeTypes.json"),
40
+ synthTargets: await safeImport("./data/synthTargets.json"),
41
+ steelPath: await safeImport("./data/steelPath.json")
42
+ };
43
+ const bundle = {
44
+ en: enUS,
45
+ ...enUS,
46
+ locales
47
+ };
48
+ for await (const locale of locales)
49
+ /**
50
+ * Translations bundle for $locale
51
+ * @type {WorldstateLangBundle}
52
+ */
53
+ bundle[locale] = {
54
+ arcanes: await safeImport(`./data/${locale}/arcanes.json`, enUS.arcanes),
55
+ archonShards: await safeImport(`./data/${locale}/archonShards.json`, enUS.archonShards),
56
+ conclave: await safeImport(`./data/${locale}/conclaveData.json`, enUS.conclave),
57
+ events: await safeImport(`./data/${locale}/eventsData.json`, enUS.events),
58
+ factions: await safeImport(`./data/${locale}/factionsData.json`, enUS.factions),
59
+ fissureModifiers: await safeImport(`./data/${locale}/fissureModifiers.json`, enUS.fissureModifiers),
60
+ languages: await safeImport(`./data/${locale}/languages.json`, enUS.languages),
61
+ missionTypes: await safeImport(`./data/${locale}/missionTypes.json`, enUS.missionTypes),
62
+ operationTypes: await safeImport(`./data/${locale}/operationTypes.json`, enUS.operationTypes),
63
+ persistentEnemy: await safeImport(`./data/${locale}/persistentEnemyData.json`, enUS.persistentEnemy),
64
+ solNodes: await safeImport(`./data/${locale}/solNodes.json`, enUS.solNodes),
65
+ sortie: await safeImport(`./data/${locale}/sortieData.json`, enUS.sortie),
66
+ syndicates: await safeImport(`./data/${locale}/syndicatesData.json`, enUS.syndicates),
67
+ tutorials: await safeImport(`./data/${locale}/tutorials.json`, enUS.tutorials),
68
+ upgradeTypes: await safeImport(`./data/${locale}/upgradeTypes.json`, enUS.upgradeTypes),
69
+ synthTargets: await safeImport(`./data/${locale}/synthTargets.json`, enUS.synthTargets),
70
+ steelPath: await safeImport(`./data/${locale}/steelPath.json`, enUS.steelPath)
71
+ };
72
+ locales.push("en");
73
+ return bundle;
74
+ };
75
+ var exports_default = await makeBundle();
76
+
77
+ //#endregion
78
+ export { exports_default as t };
@@ -1,3 +1,3 @@
1
- import "./types-3hUBzsIn.mjs";
2
- import { n as WorldstateLangBundle, r as _default, t as Locale } from "./exports-CZKY8idU.mjs";
1
+ import "./types-BambsMUW.mjs";
2
+ import { n as WorldstateLangBundle, r as _default, t as Locale } from "./exports-BaguOygr.mjs";
3
3
  export { Locale, WorldstateLangBundle, _default as default };
package/dist/exports.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import "./safeImport-D7h_Y_6K.mjs";
2
- import { t as exports_default } from "./exports-DvjlJ_m2.mjs";
1
+ import "./safeImport-CE5wf6im.mjs";
2
+ import { t as exports_default } from "./exports-M2P8p7tW.mjs";
3
3
 
4
4
  export { exports_default as default };
@@ -7,15 +7,13 @@
7
7
  */
8
8
  const safeImport = async (path, fallback = {}) => {
9
9
  try {
10
- const mod = await import(path, path.includes(".json") ? { with: { type: "json" } } : {});
11
- if (mod?.default) return mod.default;
12
- return mod;
10
+ const mod = path.includes(".json") ? await import(path, { with: { type: "json" } }) : await import(path);
11
+ return "default" in mod ? mod.default : mod;
13
12
  } catch (error) {
14
13
  if ((process.env.LOG_LEVEL || "ERROR").toUpperCase() === "DEBUG") console.debug(`Failed to load module at ${path} ... returning fallback`);
15
14
  return fallback;
16
15
  }
17
16
  };
18
- var safeImport_default = safeImport;
19
17
 
20
18
  //#endregion
21
- export { safeImport_default as t };
19
+ export { safeImport as t };
@@ -5,6 +5,6 @@
5
5
  * @param {Object} fallback fallback response if error or no module
6
6
  * @returns {Promise<any>} module or the default object
7
7
  */
8
- declare const safeImport: <T>(path: string, fallback?: T) => Promise<T>;
8
+ declare const safeImport: <T extends object>(path: string, fallback?: T) => Promise<T>;
9
9
  //#endregion
10
- export { safeImport as default };
10
+ export { safeImport };
@@ -1,3 +1,3 @@
1
- import { t as safeImport_default } from "./safeImport-D7h_Y_6K.mjs";
1
+ import { t as safeImport } from "./safeImport-CE5wf6im.mjs";
2
2
 
3
- export { safeImport_default as default };
3
+ export { safeImport };
@@ -1,4 +1,8 @@
1
1
  //#region tools/timeDate.d.ts
2
+ declare const pieceIsSmoller: (seconds: number, ceiling: number, label: string, timePieces: string[]) => {
3
+ seconds: number;
4
+ timePieces: string[];
5
+ };
2
6
  /**
3
7
  * @param {number} millis The number of milliseconds in the time delta
4
8
  * @returns {string} formatted time delta
@@ -32,14 +36,14 @@ declare const parseDate: (d?: ContentTimestamp) => Date;
32
36
  /**
33
37
  * Get a weekly reset timestamp
34
38
  */
35
- declare const weeklyReset: () => {
39
+ declare const weeklyReset: (nowFunc?: () => Date) => {
36
40
  activation: Date;
37
41
  expiry: Date;
38
42
  };
39
43
  /**
40
44
  * Get a daily reset timestamp
41
45
  */
42
- declare const dailyReset: () => {
46
+ declare const dailyReset: (nowFunc?: () => Date) => {
43
47
  activation: Date;
44
48
  expiry: Date;
45
49
  };
@@ -57,14 +61,14 @@ declare const _default: {
57
61
  fromNow: (d: Date, now?: () => number) => number;
58
62
  toNow: (d: Date, now?: () => number) => number;
59
63
  parseDate: (d?: ContentTimestamp) => Date;
60
- dailyReset: () => {
64
+ dailyReset: (nowFunc?: () => Date) => {
61
65
  activation: Date;
62
66
  expiry: Date;
63
67
  };
64
- weeklyReset: () => {
68
+ weeklyReset: (nowFunc?: () => Date) => {
65
69
  activation: Date;
66
70
  expiry: Date;
67
71
  };
68
72
  };
69
73
  //#endregion
70
- export { parseDate as a, weeklyReset as c, fromNow as i, _default as n, timeDeltaToString as o, dailyReset as r, toNow as s, ContentTimestamp as t };
74
+ export { parseDate as a, toNow as c, fromNow as i, weeklyReset as l, _default as n, pieceIsSmoller as o, dailyReset as r, timeDeltaToString as s, ContentTimestamp as t };
@@ -57,8 +57,8 @@ const parseDate = (d) => {
57
57
  /**
58
58
  * Get a weekly reset timestamp
59
59
  */
60
- const weeklyReset = () => {
61
- const now = /* @__PURE__ */ new Date();
60
+ const weeklyReset = (nowFunc = () => /* @__PURE__ */ new Date()) => {
61
+ const now = nowFunc();
62
62
  const currentDay = now.getUTCDay();
63
63
  const daysUntilNextMonday = currentDay === 0 ? 1 : 8 - currentDay;
64
64
  const expiry = new Date(now.getTime());
@@ -74,8 +74,8 @@ const weeklyReset = () => {
74
74
  /**
75
75
  * Get a daily reset timestamp
76
76
  */
77
- const dailyReset = () => {
78
- const now = /* @__PURE__ */ new Date();
77
+ const dailyReset = (nowFunc = () => /* @__PURE__ */ new Date()) => {
78
+ const now = nowFunc();
79
79
  const activation = new Date(now.getTime());
80
80
  activation.setUTCHours(0, 0, 0, 0);
81
81
  const expiry = new Date(now.getTime());
@@ -105,4 +105,4 @@ var timeDate_default = {
105
105
  };
106
106
 
107
107
  //#endregion
108
- export { timeDeltaToString as a, timeDate_default as i, fromNow as n, toNow as o, parseDate as r, weeklyReset as s, dailyReset as t };
108
+ export { timeDate_default as a, weeklyReset as c, pieceIsSmoller as i, fromNow as n, timeDeltaToString as o, parseDate as r, toNow as s, dailyReset as t };
@@ -1,2 +1,2 @@
1
- import { a as parseDate, c as weeklyReset, i as fromNow, n as _default, o as timeDeltaToString, r as dailyReset, s as toNow, t as ContentTimestamp } from "../timeDate-Cpr1zckd.mjs";
2
- export { ContentTimestamp, dailyReset, _default as default, fromNow, parseDate, timeDeltaToString, toNow, weeklyReset };
1
+ import { a as parseDate, c as toNow, i as fromNow, l as weeklyReset, n as _default, o as pieceIsSmoller, r as dailyReset, s as timeDeltaToString, t as ContentTimestamp } from "../timeDate-CWdYuKRw.mjs";
2
+ export { ContentTimestamp, dailyReset, _default as default, fromNow, parseDate, pieceIsSmoller, timeDeltaToString, toNow, weeklyReset };
@@ -1,3 +1,3 @@
1
- import { a as timeDeltaToString, i as timeDate_default, n as fromNow, o as toNow, r as parseDate, s as weeklyReset, t as dailyReset } from "../timeDate-CgKkhsih.mjs";
1
+ import { a as timeDate_default, c as weeklyReset, i as pieceIsSmoller, n as fromNow, o as timeDeltaToString, r as parseDate, s as toNow, t as dailyReset } from "../timeDate-Dr-FUBZ2.mjs";
2
2
 
3
- export { dailyReset, timeDate_default as default, fromNow, parseDate, timeDeltaToString, toNow, weeklyReset };
3
+ export { dailyReset, timeDate_default as default, fromNow, parseDate, pieceIsSmoller, timeDeltaToString, toNow, weeklyReset };
@@ -1,4 +1,4 @@
1
- import "../types-3hUBzsIn.mjs";
2
- import "../exports-CZKY8idU.mjs";
3
- import { A as translateCalendarEvent, C as sortieModDesc, D as syndicate, E as steelPath, M as translatePolarity, N as translateSeason, O as toTitleCase, P as upgrade, S as sortieFaction, T as splitResourceName, _ as nodeMissionType, a as conclaveCategory, b as region, c as faction, d as languageDesc, f as languageString, g as nodeEnemy, h as node, i as archonShardUpgradeType, j as translateFocus, k as translateArchimedeaType, l as fissureModifier, m as missionType, n as archonShard, o as conclaveChallenge, p as lastResourceName, r as archonShardColor, s as conclaveMode, t as _default, u as fissureTier, v as operation, w as sortieModifier, x as sortieBoss, y as operationSymbol } from "../translation-Dl9Sx9Td.mjs";
1
+ import "../types-BambsMUW.mjs";
2
+ import "../exports-BaguOygr.mjs";
3
+ import { A as translateCalendarEvent, C as sortieModDesc, D as syndicate, E as steelPath, M as translatePolarity, N as translateSeason, O as toTitleCase, P as upgrade, S as sortieFaction, T as splitResourceName, _ as nodeMissionType, a as conclaveCategory, b as region, c as faction, d as languageDesc, f as languageString, g as nodeEnemy, h as node, i as archonShardUpgradeType, j as translateFocus, k as translateArchimedeaType, l as fissureModifier, m as missionType, n as archonShard, o as conclaveChallenge, p as lastResourceName, r as archonShardColor, s as conclaveMode, t as _default, u as fissureTier, v as operation, w as sortieModifier, x as sortieBoss, y as operationSymbol } from "../translation-DfnYeyoz.mjs";
4
4
  export { archonShard, archonShardColor, archonShardUpgradeType, conclaveCategory, conclaveChallenge, conclaveMode, _default as default, faction, fissureModifier, fissureTier, languageDesc, languageString, lastResourceName, missionType, node, nodeEnemy, nodeMissionType, operation, operationSymbol, region, sortieBoss, sortieFaction, sortieModDesc, sortieModifier, splitResourceName, steelPath, syndicate, toTitleCase, translateArchimedeaType, translateCalendarEvent, translateFocus, translatePolarity, translateSeason, upgrade };
@@ -1,5 +1,5 @@
1
- import "../safeImport-D7h_Y_6K.mjs";
2
- import "../exports-DvjlJ_m2.mjs";
3
- import { A as translateFocus, C as sortieModifier, D as toTitleCase, E as syndicate, M as translateSeason, N as translation_default, O as translateArchimedeaType, P as upgrade, S as sortieModDesc, T as steelPath, _ as operation, a as conclaveChallenge, b as sortieBoss, c as fissureModifier, d as languageString, f as lastResourceName, g as nodeMissionType, h as nodeEnemy, i as conclaveCategory, j as translatePolarity, k as translateCalendarEvent, l as fissureTier, m as node, n as archonShardColor, o as conclaveMode, p as missionType, r as archonShardUpgradeType, s as faction, t as archonShard, u as languageDesc, v as operationSymbol, w as splitResourceName, x as sortieFaction, y as region } from "../translation-aFS3KGXn.mjs";
1
+ import "../safeImport-CE5wf6im.mjs";
2
+ import "../exports-M2P8p7tW.mjs";
3
+ import { A as translateFocus, C as sortieModifier, D as toTitleCase, E as syndicate, M as translateSeason, N as translation_default, O as translateArchimedeaType, P as upgrade, S as sortieModDesc, T as steelPath, _ as operation, a as conclaveChallenge, b as sortieBoss, c as fissureModifier, d as languageString, f as lastResourceName, g as nodeMissionType, h as nodeEnemy, i as conclaveCategory, j as translatePolarity, k as translateCalendarEvent, l as fissureTier, m as node, n as archonShardColor, o as conclaveMode, p as missionType, r as archonShardUpgradeType, s as faction, t as archonShard, u as languageDesc, v as operationSymbol, w as splitResourceName, x as sortieFaction, y as region } from "../translation-B1nyVzj0.mjs";
4
4
 
5
5
  export { archonShard, archonShardColor, archonShardUpgradeType, conclaveCategory, conclaveChallenge, conclaveMode, translation_default as default, faction, fissureModifier, fissureTier, languageDesc, languageString, lastResourceName, missionType, node, nodeEnemy, nodeMissionType, operation, operationSymbol, region, sortieBoss, sortieFaction, sortieModDesc, sortieModifier, splitResourceName, steelPath, syndicate, toTitleCase, translateArchimedeaType, translateCalendarEvent, translateFocus, translatePolarity, translateSeason, upgrade };
@@ -1,6 +1,14 @@
1
- import "../types-3hUBzsIn.mjs";
2
- import "../exports-CZKY8idU.mjs";
3
- import { t as insist } from "../integrity-B8tf4op5.mjs";
4
- import { a as parseDate, c as weeklyReset, i as fromNow, o as timeDeltaToString, r as dailyReset, s as toNow, t as ContentTimestamp } from "../timeDate-Cpr1zckd.mjs";
5
- import { A as translateCalendarEvent, C as sortieModDesc, D as syndicate, E as steelPath, M as translatePolarity, N as translateSeason, O as toTitleCase, P as upgrade, S as sortieFaction, T as splitResourceName, _ as nodeMissionType, a as conclaveCategory, b as region, c as faction, d as languageDesc, f as languageString, g as nodeEnemy, h as node, i as archonShardUpgradeType, j as translateFocus, k as translateArchimedeaType, l as fissureModifier, m as missionType, n as archonShard, o as conclaveChallenge, p as lastResourceName, r as archonShardColor, s as conclaveMode, u as fissureTier, v as operation, w as sortieModifier, x as sortieBoss, y as operationSymbol } from "../translation-Dl9Sx9Td.mjs";
6
- export { ContentTimestamp, archonShard, archonShardColor, archonShardUpgradeType, conclaveCategory, conclaveChallenge, conclaveMode, dailyReset, faction, fissureModifier, fissureTier, fromNow, insist, languageDesc, languageString, lastResourceName, missionType, node, nodeEnemy, nodeMissionType, operation, operationSymbol, parseDate, region, sortieBoss, sortieFaction, sortieModDesc, sortieModifier, splitResourceName, steelPath, syndicate, timeDeltaToString, toNow, toTitleCase, translateArchimedeaType, translateCalendarEvent, translateFocus, translatePolarity, translateSeason, upgrade, weeklyReset };
1
+ import "../types-BambsMUW.mjs";
2
+ import "../exports-BaguOygr.mjs";
3
+ import { a as parseDate, c as toNow, i as fromNow, l as weeklyReset, o as pieceIsSmoller, r as dailyReset, s as timeDeltaToString, t as ContentTimestamp } from "../timeDate-CWdYuKRw.mjs";
4
+ import { A as translateCalendarEvent, C as sortieModDesc, D as syndicate, E as steelPath, M as translatePolarity, N as translateSeason, O as toTitleCase, P as upgrade, S as sortieFaction, T as splitResourceName, _ as nodeMissionType, a as conclaveCategory, b as region, c as faction, d as languageDesc, f as languageString, g as nodeEnemy, h as node, i as archonShardUpgradeType, j as translateFocus, k as translateArchimedeaType, l as fissureModifier, m as missionType, n as archonShard, o as conclaveChallenge, p as lastResourceName, r as archonShardColor, s as conclaveMode, u as fissureTier, v as operation, w as sortieModifier, x as sortieBoss, y as operationSymbol } from "../translation-DfnYeyoz.mjs";
5
+
6
+ //#region tools/integrity.d.ts
7
+ /**
8
+ * @description Insist that the provided data has the required properties.
9
+ * @param {Record<string, unknown>} thing to encourage to have data
10
+ * @param {...string} args arguments to ensure
11
+ */
12
+ declare const insist: (thing: Record<string, unknown>, ...args: string[]) => void;
13
+ //#endregion
14
+ export { ContentTimestamp, archonShard, archonShardColor, archonShardUpgradeType, conclaveCategory, conclaveChallenge, conclaveMode, dailyReset, faction, fissureModifier, fissureTier, fromNow, insist, languageDesc, languageString, lastResourceName, missionType, node, nodeEnemy, nodeMissionType, operation, operationSymbol, parseDate, pieceIsSmoller, region, sortieBoss, sortieFaction, sortieModDesc, sortieModifier, splitResourceName, steelPath, syndicate, timeDeltaToString, toNow, toTitleCase, translateArchimedeaType, translateCalendarEvent, translateFocus, translatePolarity, translateSeason, upgrade, weeklyReset };
@@ -1,7 +1,20 @@
1
- import "../safeImport-D7h_Y_6K.mjs";
2
- import "../exports-DvjlJ_m2.mjs";
3
- import { t as insist } from "../integrity-l9XvAM5B.mjs";
4
- import { a as timeDeltaToString, n as fromNow, o as toNow, r as parseDate, s as weeklyReset, t as dailyReset } from "../timeDate-CgKkhsih.mjs";
5
- import { A as translateFocus, C as sortieModifier, D as toTitleCase, E as syndicate, M as translateSeason, O as translateArchimedeaType, P as upgrade, S as sortieModDesc, T as steelPath, _ as operation, a as conclaveChallenge, b as sortieBoss, c as fissureModifier, d as languageString, f as lastResourceName, g as nodeMissionType, h as nodeEnemy, i as conclaveCategory, j as translatePolarity, k as translateCalendarEvent, l as fissureTier, m as node, n as archonShardColor, o as conclaveMode, p as missionType, r as archonShardUpgradeType, s as faction, t as archonShard, u as languageDesc, v as operationSymbol, w as splitResourceName, x as sortieFaction, y as region } from "../translation-aFS3KGXn.mjs";
1
+ import "../safeImport-CE5wf6im.mjs";
2
+ import "../exports-M2P8p7tW.mjs";
3
+ import { c as weeklyReset, i as pieceIsSmoller, n as fromNow, o as timeDeltaToString, r as parseDate, s as toNow, t as dailyReset } from "../timeDate-Dr-FUBZ2.mjs";
4
+ import { A as translateFocus, C as sortieModifier, D as toTitleCase, E as syndicate, M as translateSeason, O as translateArchimedeaType, P as upgrade, S as sortieModDesc, T as steelPath, _ as operation, a as conclaveChallenge, b as sortieBoss, c as fissureModifier, d as languageString, f as lastResourceName, g as nodeMissionType, h as nodeEnemy, i as conclaveCategory, j as translatePolarity, k as translateCalendarEvent, l as fissureTier, m as node, n as archonShardColor, o as conclaveMode, p as missionType, r as archonShardUpgradeType, s as faction, t as archonShard, u as languageDesc, v as operationSymbol, w as splitResourceName, x as sortieFaction, y as region } from "../translation-B1nyVzj0.mjs";
6
5
 
7
- export { archonShard, archonShardColor, archonShardUpgradeType, conclaveCategory, conclaveChallenge, conclaveMode, dailyReset, faction, fissureModifier, fissureTier, fromNow, insist, languageDesc, languageString, lastResourceName, missionType, node, nodeEnemy, nodeMissionType, operation, operationSymbol, parseDate, region, sortieBoss, sortieFaction, sortieModDesc, sortieModifier, splitResourceName, steelPath, syndicate, timeDeltaToString, toNow, toTitleCase, translateArchimedeaType, translateCalendarEvent, translateFocus, translatePolarity, translateSeason, upgrade, weeklyReset };
6
+ //#region tools/integrity.ts
7
+ /**
8
+ * @description Insist that the provided data has the required properties.
9
+ * @param {Record<string, unknown>} thing to encourage to have data
10
+ * @param {...string} args arguments to ensure
11
+ */
12
+ const insist = (thing, ...args) => {
13
+ if (!thing || !Object.keys(thing).length) throw new TypeError("No data provided.");
14
+ args.forEach((arg) => {
15
+ if (!(arg in thing)) throw new TypeError(`Missing required property: '${arg}'.`);
16
+ });
17
+ };
18
+
19
+ //#endregion
20
+ export { archonShard, archonShardColor, archonShardUpgradeType, conclaveCategory, conclaveChallenge, conclaveMode, dailyReset, faction, fissureModifier, fissureTier, fromNow, insist, languageDesc, languageString, lastResourceName, missionType, node, nodeEnemy, nodeMissionType, operation, operationSymbol, parseDate, pieceIsSmoller, region, sortieBoss, sortieFaction, sortieModDesc, sortieModifier, splitResourceName, steelPath, syndicate, timeDeltaToString, toNow, toTitleCase, translateArchimedeaType, translateCalendarEvent, translateFocus, translatePolarity, translateSeason, upgrade, weeklyReset };
@@ -1,4 +1,4 @@
1
- import { t as exports_default } from "./exports-DvjlJ_m2.mjs";
1
+ import { t as exports_default } from "./exports-M2P8p7tW.mjs";
2
2
 
3
3
  //#region tools/translation.ts
4
4
  /**
@@ -1,5 +1,5 @@
1
- import { n as ArchonShard, s as SteelPath } from "./types-3hUBzsIn.mjs";
2
- import { t as Locale } from "./exports-CZKY8idU.mjs";
1
+ import { n as ArchonShard, s as SteelPath } from "./types-BambsMUW.mjs";
2
+ import { t as Locale } from "./exports-BaguOygr.mjs";
3
3
 
4
4
  //#region tools/translation.d.ts
5
5
 
package/dist/types.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { a as SolNode, c as SteelPathOffering, i as Events, l as SynthesisTarget, n as ArchonShard, o as SortieData, r as Conclave, s as SteelPath, t as Arcane } from "./types-3hUBzsIn.mjs";
1
+ import { a as SolNode, c as SteelPathOffering, i as Events, l as SynthesisTarget, n as ArchonShard, o as SortieData, r as Conclave, s as SteelPath, t as Arcane } from "./types-BambsMUW.mjs";
2
2
  export { Arcane, ArchonShard, Conclave, Events, SolNode, SortieData, SteelPath, SteelPathOffering, SynthesisTarget };
package/exports.ts CHANGED
@@ -1,4 +1,4 @@
1
- import safeImport from './safeImport';
1
+ import { safeImport } from './safeImport';
2
2
  import { Arcane, ArchonShard, Conclave, Events, SolNode, SortieData, SteelPath, SynthesisTarget } from './types';
3
3
 
4
4
  export type Locale = 'de' | 'en' | 'es' | 'fr' | 'it' | 'ko' | 'pl' | 'pt' | 'ru' | 'zh' | 'cs' | 'sr' | 'uk';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "warframe-worldstate-data",
3
- "version": "3.1.10",
3
+ "version": "3.1.12",
4
4
  "description": "Warframe data for use with warframe-worldstate-parser",
5
5
  "keywords": [
6
6
  "warframe-worldstate",
@@ -36,11 +36,11 @@
36
36
  ],
37
37
  "type": "module",
38
38
  "exports": {
39
- ".": "./dist/exports.js",
40
- "./utilities": "./dist/tools/utilities.js",
41
- "./types": "./dist/types.js"
39
+ ".": "./dist/exports.mjs",
40
+ "./utilities": "./dist/tools/utilities.mjs",
41
+ "./types": "./dist/types.mjs"
42
42
  },
43
- "main": "./dist/exports.js",
43
+ "main": "./dist/exports.mjs",
44
44
  "directories": {
45
45
  "test": "test"
46
46
  },
@@ -51,8 +51,8 @@
51
51
  "prepare": "husky && npx install-peerdeps @wfcd/eslint-config@latest -S",
52
52
  "prepublishOnly": "npm run build",
53
53
  "sort": "tsx ./tools/sortLanguages.ts",
54
- "test": "c8 mocha",
55
- "test:cov": "npm test && c8 report --reporter=text-lcov | npx coveralls",
54
+ "test": "nyc mocha",
55
+ "test:cov": "npm test && nyc report --reporter=text-lcov | npx coveralls",
56
56
  "validate": "npm run lint:fix && npm run test && git add -u ."
57
57
  },
58
58
  "prettier": "@wfcd/eslint-config/prettier",
@@ -62,9 +62,10 @@
62
62
  }
63
63
  },
64
64
  "devDependencies": {
65
- "@biomejs/biome": "2.3.6",
65
+ "@biomejs/biome": "2.3.7",
66
66
  "@commitlint/cli": "^20.0.0",
67
67
  "@commitlint/config-conventional": "^20.0.0",
68
+ "@istanbuljs/nyc-config-typescript": "^1.0.2",
68
69
  "@types/chai": "^5.0.0",
69
70
  "@types/mocha": "^10.0.10",
70
71
  "@types/node": "^24.0.7",
@@ -73,13 +74,13 @@
73
74
  "@types/yargs": "^17.0.33",
74
75
  "ajv": "^8.17.1",
75
76
  "ajv-formats": "^3.0.1",
76
- "c8": "^10.1.3",
77
77
  "chai": "^6.0.1",
78
78
  "chai-json": "^1.0.0",
79
79
  "chai-json-schema-ajv": "^5.2.4",
80
80
  "husky": "^9.0.11",
81
81
  "lint-staged": "^16.0.0",
82
82
  "mocha": "^11.7.1",
83
+ "nyc": "^17.1.0",
83
84
  "prettier": "^3.6.2",
84
85
  "sinon": "^21.0.0",
85
86
  "sinon-chai": "^4.0.0",
package/safeImport.ts CHANGED
@@ -7,14 +7,14 @@
7
7
  * @param {Object} fallback fallback response if error or no module
8
8
  * @returns {Promise<any>} module or the default object
9
9
  */
10
- const safeImport = async <T>(path: string, fallback: T = {} as T): Promise<T> => {
10
+ export const safeImport = async <T extends object>(path: string, fallback: T = {} as T): Promise<T> => {
11
11
  try {
12
- const mod: any = await import(path, path.includes('.json') ? { with: { type: 'json' } } : {});
13
- if (mod?.default) return mod.default as T;
14
- return mod as T;
12
+ const mod: T | { default: T } = path.includes('.json')
13
+ ? await import(path, { with: { type: 'json' } })
14
+ : await import(path);
15
+ return 'default' in mod ? (mod as { default: T }).default : (mod as T);
15
16
  } catch (error) {
16
17
  if ((process.env.LOG_LEVEL || 'ERROR').toUpperCase() === 'DEBUG') {
17
- // eslint-disable-next-line no-console
18
18
  console.debug(`Failed to load module at ${path} ... returning fallback`);
19
19
  }
20
20
 
@@ -22,4 +22,3 @@ const safeImport = async <T>(path: string, fallback: T = {} as T): Promise<T> =>
22
22
  }
23
23
  };
24
24
 
25
- export default safeImport;
@@ -1,16 +1,16 @@
1
1
  /**
2
2
  * @description Insist that the provided data has the required properties.
3
- * @param thing to encourage to have data
4
- * @param args arguments to ensure
3
+ * @param {Record<string, unknown>} thing to encourage to have data
4
+ * @param {...string} args arguments to ensure
5
5
  */
6
6
  export const insist = (thing: Record<string, unknown>, ...args: string[]) => {
7
7
  if (!thing || !Object.keys(thing).length) {
8
- throw new TypeError('The provided data does not have the required properties.');
8
+ throw new TypeError('No data provided.');
9
9
  }
10
10
 
11
11
  args.forEach((arg) => {
12
- if (!thing[arg]) {
13
- throw new TypeError('The provided data does not have the required properties.');
12
+ if (!(arg in thing)) {
13
+ throw new TypeError(`Missing required property: '${arg}'.`);
14
14
  }
15
15
  });
16
- };
16
+ };
package/tools/timeDate.ts CHANGED
@@ -4,7 +4,7 @@ const epochZero: ContentTimestamp = {
4
4
  },
5
5
  };
6
6
 
7
- const pieceIsSmoller = (seconds: number, ceiling: number, label: string, timePieces: string[]) => {
7
+ export const pieceIsSmoller = (seconds: number, ceiling: number, label: string, timePieces: string[]) => {
8
8
  if (seconds >= ceiling) {
9
9
  timePieces.push(`${Math.floor(seconds / ceiling)}${label}`);
10
10
  seconds = Math.floor(seconds) % ceiling;
@@ -79,8 +79,8 @@ export const parseDate = (d?: ContentTimestamp): Date => {
79
79
  /**
80
80
  * Get a weekly reset timestamp
81
81
  */
82
- export const weeklyReset = (): { activation: Date; expiry: Date } => {
83
- const now = new Date();
82
+ export const weeklyReset = (nowFunc = () => new Date()): { activation: Date; expiry: Date } => {
83
+ const now = nowFunc();
84
84
  const currentDay = now.getUTCDay();
85
85
  const daysUntilNextMonday = currentDay === 0 ? 1 : 8 - currentDay;
86
86
 
@@ -97,8 +97,8 @@ export const weeklyReset = (): { activation: Date; expiry: Date } => {
97
97
  /**
98
98
  * Get a daily reset timestamp
99
99
  */
100
- export const dailyReset = (): { activation: Date; expiry: Date } => {
101
- const now = new Date();
100
+ export const dailyReset = (nowFunc = () => new Date()): { activation: Date; expiry: Date } => {
101
+ const now = nowFunc();
102
102
 
103
103
  const activation = new Date(now.getTime());
104
104
  activation.setUTCHours(0, 0, 0, 0);
@@ -1,3 +1,5 @@
1
+ /* istanbul ignore file */
2
+
1
3
  export * from './integrity';
2
4
  export * from './timeDate';
3
5
  export * from './translation';
package/tsdown.config.ts CHANGED
@@ -5,11 +5,11 @@ export default defineConfig({
5
5
  'exports.ts',
6
6
  'safeImport.ts',
7
7
  'types.ts',
8
- './tools/integrity.ts',
9
8
  './tools/timeDate.ts',
10
9
  './tools/translation.ts',
11
10
  './tools/utilities.ts',
12
11
  ],
13
12
  copy: ['./data'],
14
- dts: true
13
+ dts: true,
14
+ format: 'esm',
15
15
  });
package/.c8rc.json DELETED
@@ -1,5 +0,0 @@
1
- {
2
- "exclude": ["test/**"],
3
- "reporter": ["lcov", "text"],
4
- "skip-full": true
5
- }
@@ -1,78 +0,0 @@
1
- import { t as safeImport_default } from "./safeImport-D7h_Y_6K.mjs";
2
-
3
- //#region exports.ts
4
- const locales = [
5
- "de",
6
- "es",
7
- "fr",
8
- "it",
9
- "ko",
10
- "pl",
11
- "pt",
12
- "ru",
13
- "zh",
14
- "cs",
15
- "sr",
16
- "uk"
17
- ];
18
- const makeBundle = async () => {
19
- /**
20
- * English United States translations bundle,
21
- * default translations
22
- * @type {WorldstateLangBundle}
23
- */
24
- const enUS = {
25
- arcanes: await safeImport_default("./data/arcanes.json"),
26
- archonShards: await safeImport_default("./data/archonShards.json"),
27
- conclave: await safeImport_default("./data/conclaveData.json"),
28
- events: await safeImport_default("./data/eventsData.json"),
29
- factions: await safeImport_default("./data/factionsData.json"),
30
- fissureModifiers: await safeImport_default("./data/fissureModifiers.json"),
31
- languages: await safeImport_default("./data/languages.json"),
32
- missionTypes: await safeImport_default("./data/missionTypes.json"),
33
- operationTypes: await safeImport_default("./data/operationTypes.json"),
34
- persistentEnemy: await safeImport_default("./data/persistentEnemyData.json"),
35
- solNodes: await safeImport_default("./data/solNodes.json"),
36
- sortie: await safeImport_default("./data/sortieData.json"),
37
- syndicates: await safeImport_default("./data/syndicatesData.json"),
38
- tutorials: await safeImport_default("./data/tutorials.json"),
39
- upgradeTypes: await safeImport_default("./data/upgradeTypes.json"),
40
- synthTargets: await safeImport_default("./data/synthTargets.json"),
41
- steelPath: await safeImport_default("./data/steelPath.json")
42
- };
43
- const bundle = {
44
- en: enUS,
45
- ...enUS,
46
- locales
47
- };
48
- for await (const locale of locales)
49
- /**
50
- * Translations bundle for $locale
51
- * @type {WorldstateLangBundle}
52
- */
53
- bundle[locale] = {
54
- arcanes: await safeImport_default(`./data/${locale}/arcanes.json`, enUS.arcanes),
55
- archonShards: await safeImport_default(`./data/${locale}/archonShards.json`, enUS.archonShards),
56
- conclave: await safeImport_default(`./data/${locale}/conclaveData.json`, enUS.conclave),
57
- events: await safeImport_default(`./data/${locale}/eventsData.json`, enUS.events),
58
- factions: await safeImport_default(`./data/${locale}/factionsData.json`, enUS.factions),
59
- fissureModifiers: await safeImport_default(`./data/${locale}/fissureModifiers.json`, enUS.fissureModifiers),
60
- languages: await safeImport_default(`./data/${locale}/languages.json`, enUS.languages),
61
- missionTypes: await safeImport_default(`./data/${locale}/missionTypes.json`, enUS.missionTypes),
62
- operationTypes: await safeImport_default(`./data/${locale}/operationTypes.json`, enUS.operationTypes),
63
- persistentEnemy: await safeImport_default(`./data/${locale}/persistentEnemyData.json`, enUS.persistentEnemy),
64
- solNodes: await safeImport_default(`./data/${locale}/solNodes.json`, enUS.solNodes),
65
- sortie: await safeImport_default(`./data/${locale}/sortieData.json`, enUS.sortie),
66
- syndicates: await safeImport_default(`./data/${locale}/syndicatesData.json`, enUS.syndicates),
67
- tutorials: await safeImport_default(`./data/${locale}/tutorials.json`, enUS.tutorials),
68
- upgradeTypes: await safeImport_default(`./data/${locale}/upgradeTypes.json`, enUS.upgradeTypes),
69
- synthTargets: await safeImport_default(`./data/${locale}/synthTargets.json`, enUS.synthTargets),
70
- steelPath: await safeImport_default(`./data/${locale}/steelPath.json`, enUS.steelPath)
71
- };
72
- locales.push("en");
73
- return bundle;
74
- };
75
- var exports_default = await makeBundle();
76
-
77
- //#endregion
78
- export { exports_default as t };
@@ -1,9 +0,0 @@
1
- //#region tools/integrity.d.ts
2
- /**
3
- * @description Insist that the provided data has the required properties.
4
- * @param thing to encourage to have data
5
- * @param args arguments to ensure
6
- */
7
- declare const insist: (thing: Record<string, unknown>, ...args: string[]) => void;
8
- //#endregion
9
- export { insist as t };
@@ -1,15 +0,0 @@
1
- //#region tools/integrity.ts
2
- /**
3
- * @description Insist that the provided data has the required properties.
4
- * @param thing to encourage to have data
5
- * @param args arguments to ensure
6
- */
7
- const insist = (thing, ...args) => {
8
- if (!thing || !Object.keys(thing).length) throw new TypeError("The provided data does not have the required properties.");
9
- args.forEach((arg) => {
10
- if (!thing[arg]) throw new TypeError("The provided data does not have the required properties.");
11
- });
12
- };
13
-
14
- //#endregion
15
- export { insist as t };
@@ -1,2 +0,0 @@
1
- import { t as insist } from "../integrity-B8tf4op5.mjs";
2
- export { insist };
@@ -1,3 +0,0 @@
1
- import { t as insist } from "../integrity-l9XvAM5B.mjs";
2
-
3
- export { insist };