ships.Function.getSourceModuleValue - Elite-Dangerous-Almanac/Almanac-Core GitHub Wiki
@elite-dangerous-almanac/core / ships / getSourceModuleValue
getSourceModuleValue(
record,slotKey):SourceModuleValue|null
Defined in: src/ships/source-purchase.ts:140
Find the captured purchase entry for one slot.
Purchase snapshot to query.
string
Slot key such as "PowerPlant". An exact spelling wins; otherwise
matching folds case and ignores surrounding whitespace, as every identifier lookup in
the library does, so journal and lower-cased SLEF keys interoperate.
SourceModuleValue | null
The frozen entry, or null when the source priced no module in that slot.
null never means the module was free.
If slotKey is present and not a string. A nullish slotKey is a
miss, answered the way a slot the source did not price is.
import {
getSourceModuleValue,
type SourcePurchaseRecord,
} from '@elite-dangerous-almanac/core/ships/source-purchase';
declare const paid: SourcePurchaseRecord;
getSourceModuleValue(paid, 'FrameShiftDrive')?.value; // captured credits