style: move randInRange to utils

This commit is contained in:
2026-06-19 04:05:38 -03:00
parent 4c76abc274
commit e11e2093b0
4 changed files with 19 additions and 21 deletions
-7
View File
@@ -30,7 +30,6 @@ export const getItemType = (id: string): ItemType => {
return 'other';
};
export const getItemIconUrl = (iconFilePath: string) => {
const file = (iconFilePath.split('/').pop() ?? '').split('.')[0];
return `${DB_BASE_URL}/icons/item-icons/${file}.png`;
@@ -40,9 +39,3 @@ export const getOfferingIconUrl = (iconFilePath: string) => {
const file = (iconFilePath.split('/').pop() ?? '').split('.')[0];
return `${DB_BASE_URL}/icons/offering-icons/${file}.png`;
};
export const randInRange = (min: number, max: number) => {
const lo = Math.min(min, max);
const hi = Math.max(min, max);
return Math.floor(Math.random() * (hi - lo + 1)) + lo;
};