Files
shd.build/src/lib/weapons/category-bonuses.ts
T
JB a434cbe60c
Validate and deploy production / validate (push) Successful in 26s
Validate and deploy staging / validate (push) Successful in 25s
Validate and deploy production / deploy (push) Failing after 1m10s
Validate and deploy staging / deploy (push) Failing after 8s
feat: expand profiles and weapon configuration
2026-07-28 00:11:40 -04:00

14 lines
471 B
TypeScript

export const WEAPON_CATEGORIES = ['Shotgun', 'Rifle', 'MMR', 'AR', 'LMG', 'SMG'] as const;
export type WeaponCategory = (typeof WEAPON_CATEGORIES)[number];
export function attachWeaponCategoryBonuses<
TWeapon extends { category: unknown },
TBonus extends { weapon_category: unknown }
>(weapons: TWeapon[], bonuses: TBonus[]) {
return weapons.map((weapon) => ({
...weapon,
baseBonuses: bonuses.filter((bonus) => bonus.weapon_category === weapon.category)
}));
}