diff --git a/src/ItemConfig.js b/src/ItemConfig.js index 0e40311..cc95261 100644 --- a/src/ItemConfig.js +++ b/src/ItemConfig.js @@ -1,7 +1,7 @@ import { colors } from 'warframe-items/utilities'; import Skin from './Skin.js'; -import mapToHex from './Util.js'; +import { mapToHex } from './Utils.js'; /** * Item customizations such as colors and applied skins diff --git a/src/LoadOutItem.js b/src/LoadOutItem.js index 903b54f..a1317a5 100644 --- a/src/LoadOutItem.js +++ b/src/LoadOutItem.js @@ -3,7 +3,7 @@ import { parseDate, toTitleCase } from 'warframe-worldstate-data/utilities'; import ItemConfig from './ItemConfig.js'; import Polarity from './Polarity.js'; -import find from './Utils.js'; +import { find } from './Utils.js'; /** * An an item in LoadOutInventory diff --git a/src/OperatorLoadOuts.js b/src/OperatorLoadOuts.js index d8f9f24..f3bf101 100644 --- a/src/OperatorLoadOuts.js +++ b/src/OperatorLoadOuts.js @@ -1,7 +1,7 @@ import { colors } from 'warframe-items/utilities'; import Skin from './Skin.js'; -import mapToHex from './Util.js'; +import { mapToHex } from './Utils.js'; /** * Player's operator loadout diff --git a/src/Skin.js b/src/Skin.js index e4193fe..32da470 100644 --- a/src/Skin.js +++ b/src/Skin.js @@ -1,4 +1,4 @@ -import find from './Utils.js'; +import { find } from './Utils.js'; /** * A skin class diff --git a/src/Util.js b/src/Util.js deleted file mode 100644 index 358ffeb..0000000 --- a/src/Util.js +++ /dev/null @@ -1,14 +0,0 @@ -/** @module */ - -/** - * Map base10 int colors to hex color strings - * @param {Record} colors color map - * @returns {Record} - */ -export default function mapToHex(colors) { - const hex = {}; - Object.entries(colors).forEach(([key, /** @type {undefined | number} */ value]) => { - hex[key] = Math.abs(value).toString(16).toUpperCase(); - }); - return hex; -} diff --git a/src/Utils.js b/src/Utils.js index d72573e..d1c795a 100644 --- a/src/Utils.js +++ b/src/Utils.js @@ -1,8 +1,36 @@ import Items from 'warframe-items'; -const find = (name, locale = 'en') => { +/** @module */ + +/** + * Map base10 int colors to hex color strings + * @param {Record} colors color map + * @returns {Record} + */ +export const mapToHex = (colors) => { + const hex = {}; + Object.entries(colors).forEach(([key, /** @type {undefined | number} */ value]) => { + hex[key] = Math.abs(value).toString(16).toUpperCase(); + }); + return hex; +}; + +const categories = [ + 'Skins', + 'Primary', + 'Secondary', + 'Melee', + 'Arch-Melee', + 'Arch-Gun', + 'Warframes', + 'Archwing', + 'Sentinels', + 'Pets', +]; + +export const find = (name, locale = 'en') => { const items = new Items({ - category: ['Skins', 'Primary', 'Secondary', 'Melee', 'Arch-Melee', 'Arch-Gun', 'Warframes', 'Archwing'], + category: categories, i18n: locale, i18nOnObject: true, }); @@ -28,5 +56,3 @@ const find = (name, locale = 'en') => { return item; }; - -export default find; diff --git a/src/XpInfo.js b/src/XpInfo.js index 34f7d19..c7ad60c 100644 --- a/src/XpInfo.js +++ b/src/XpInfo.js @@ -1,4 +1,4 @@ -import find from './Utils.js'; +import { find } from './Utils.js'; /** * An item that has contributed to a player's mastery rank