materials.Function.getMicroResourceByName - Elite-Dangerous-Almanac/Almanac-Core GitHub Wiki

@elite-dangerous-almanac/core / materials / getMicroResourceByName

Function: 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).

Parameters

name

string

The display name as the catalogue spells it, e.g. "Circuit Board". Leading/trailing whitespace and case are ignored.

microResources?

readonly MicroResource[] = ALL_MICRO_RESOURCES

Optional subset to search (see getMicroResourceBySymbol).

Returns

MicroResource | null

The matching MicroResource, or null if no micro resource has that name.

Throws

If name is present and not a string. A nullish name is a miss, answered the way an unrecognised one is.

Example

import { getMicroResourceByName } from '@elite-dangerous-almanac/core/materials/micro-resources';

getMicroResourceByName('circuit board')?.symbol; // -> 'circuitboard'
⚠️ **GitHub.com Fallback** ⚠️