ships.Function.getLoadoutModifier - Elite-Dangerous-Almanac/Almanac-Core GitHub Wiki

@elite-dangerous-almanac/core / ships / getLoadoutModifier

Function: getLoadoutModifier()

getLoadoutModifier(module, label): number | null

Defined in: src/ships/slef.ts:683

Read one engineering modifier off a module by its journal label.

Parameters

module

LoadoutModule

The fitted module.

label

string

The stat's journal name, e.g. "FSDOptimalMass". Matched case-insensitively after trimming surrounding whitespace.

Returns

number | null

The modifier's numeric Value, or null if the module is not engineered, states no modifiers at all, carries no such modifier, or the modifier is non-numeric.

Throws

If label is present and not a string. A nullish label is a miss, answered the way an unrecognised one is. All engineering blocks use the same modifier representation.

Example

import { getLoadoutModifier } from '@elite-dangerous-almanac/core/ships/slef';
import type { LoadoutModule } from '@elite-dangerous-almanac/core/ships/slef';

declare const fsdModule: LoadoutModule;

getLoadoutModifier(fsdModule, 'FSDOptimalMass'); // -> 7528.04, or null if stock
⚠️ **GitHub.com Fallback** ⚠️