materials.Function.getMicroResourceByName - Elite-Dangerous-Almanac/Almanac-Core GitHub Wiki
@elite-dangerous-almanac/core / materials / getMicroResourceByName
getMicroResourceByName(
name,microResources?):MicroResource|null
Defined in: src/materials/micro-resources.ts:153
Look up a micro resource by its display name (case-insensitive).
string
The display name as the catalogue spells it, e.g. "Circuit Board".
Leading/trailing whitespace and case are ignored.
readonly MicroResource[] = ALL_MICRO_RESOURCES
Optional subset to search (see getMicroResourceBySymbol).
MicroResource | null
The matching MicroResource, or null if no micro resource has
that name.
If name is present and not a string. A nullish
name is a miss, answered the way an unrecognised one is.
import { getMicroResourceByName } from '@elite-dangerous-almanac/core/materials/micro-resources';
getMicroResourceByName('circuit board')?.symbol; // -> 'circuitboard'