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

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

Function: resolvePersonalModificationForWeapon()

resolvePersonalModificationForWeapon(weaponSymbol, journalSymbol): string

Defined in: src/equipment/modification-journal.ts:37

Resolve the modification recipe a journal symbol identifies on a handheld weapon.

Parameters

weaponSymbol

string

Frontier handheld-weapon symbol. A nullish or unknown weapon cannot resolve a collision and leaves journalSymbol unchanged.

journalSymbol

string

Symbol from the journal modification list. Matching ignores case and surrounding whitespace.

Returns

string

The recipe key used by PERSONAL_MODIFICATIONS and PERSONAL_MODIFICATION_COSTS, or journalSymbol unchanged when no collision resolves.

Throws

If journalSymbol is not a string, or if a present weapon symbol is not a string.

Example

import { resolvePersonalModificationForWeapon } from '@elite-dangerous-almanac/core/equipment/modification-journal';
resolvePersonalModificationForWeapon(
  'wpn_m_assaultrifle_kinetic_fauto',
  'weapon_range',
); // -> 'weapon_range_kinetic'
⚠️ **GitHub.com Fallback** ⚠️