equipment.Function.getPersonalWeaponGrade - Elite-Dangerous-Almanac/Almanac-Core GitHub Wiki
@elite-dangerous-almanac/core / equipment / getPersonalWeaponGrade
getPersonalWeaponGrade(
weapon,grade):PersonalWeaponGrade|null
Defined in: src/equipment/weapons.ts:187
Read one handheld weapon's stats at a grade.
A catalogue weapon record.
number
Integer grade 1–5.
PersonalWeaponGrade | null
The frozen grade record, or null when the record carries no such grade.
Every catalogued weapon carries all five, so the null is the same promise
getSuitGrade makes rather than an outcome the shipped catalogue produces —
write the two the same way and neither can surprise you.
If grade is not an integer from 1 through 5.
import { PERSONAL_WEAPONS, getPersonalWeaponGrade } from '@elite-dangerous-almanac/core/equipment/weapons';
getPersonalWeaponGrade(PERSONAL_WEAPONS[0]!, 5)?.modificationSlots; // -> 4