equipment.Function.getPersonalWeaponGrade - Elite-Dangerous-Almanac/Almanac-Core GitHub Wiki

@elite-dangerous-almanac/core / equipment / getPersonalWeaponGrade

Function: getPersonalWeaponGrade()

getPersonalWeaponGrade(weapon, grade): PersonalWeaponGrade | null

Defined in: src/equipment/weapons.ts:187

Read one handheld weapon's stats at a grade.

Parameters

weapon

PersonalWeapon

A catalogue weapon record.

grade

number

Integer grade 15.

Returns

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.

Throws

If grade is not an integer from 1 through 5.

Example

import { PERSONAL_WEAPONS, getPersonalWeaponGrade } from '@elite-dangerous-almanac/core/equipment/weapons';
getPersonalWeaponGrade(PERSONAL_WEAPONS[0]!, 5)?.modificationSlots; // -> 4
⚠️ **GitHub.com Fallback** ⚠️