materials.Function.getMicroResourceBySymbol - Elite-Dangerous-Almanac/Almanac-Core GitHub Wiki
@elite-dangerous-almanac/core / materials / getMicroResourceBySymbol
getMicroResourceBySymbol(
symbol,microResources?):MicroResource|null
Defined in: src/materials/micro-resources.ts:127
Look up a micro resource by its Frontier symbol / journal id (case-insensitive).
Here, symbol is Frontier's internal item id for the micro resource.
string
The internal symbol, e.g. "graphene", or the lower-cased form the
player journal reports. Leading/trailing whitespace and case are ignored.
readonly MicroResource[] = ALL_MICRO_RESOURCES
Optional subset to search instead of every micro
resource — COMPONENT_MICRO_RESOURCES, CONSUMABLE_MICRO_RESOURCES,
DATA_MICRO_RESOURCES, ITEM_MICRO_RESOURCES, or any array you have filtered
yourself. Omit it unless you specifically want to exclude the rest: the indexed O(1)
path is taken only when the argument is omitted or is ALL_MICRO_RESOURCES by
reference, and every other array — a copy of that same catalogue included — is
scanned.
MicroResource | null
The matching MicroResource, or null if no micro resource has
that symbol.
If symbol is present and not a string. A nullish
symbol is a miss, answered the way an unrecognised one is.
import { getMicroResourceBySymbol } from '@elite-dangerous-almanac/core/materials/micro-resources';
getMicroResourceBySymbol('circuitboard')?.name; // -> 'Circuit Board'