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

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

Function: microResourcesInCategory()

microResourcesInCategory(category): MicroResource[]

Defined in: src/materials/micro-resources.ts:178

Every micro resource in a given category, in catalogue order.

Parameters

category

string

The category to match, e.g. 'component'. Leading/trailing whitespace and case are ignored, like every other lookup here.

Returns

MicroResource[]

A new array of matches (possibly empty).

Throws

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

Example

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

microResourcesInCategory('consumable')[0]?.name;     // -> 'Medkit'
microResourcesInCategory('Consumable')[0]?.name;     // -> 'Medkit'; case is ignored
⚠️ **GitHub.com Fallback** ⚠️