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

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

Function: materialsInLine()

materialsInLine(line): Material[]

Defined in: src/materials/materials.ts:333

Every material in a given line, in catalogue order.

Parameters

line

string

The line to match, e.g. MaterialLine.Chemical. A plain string of the line's value works too: leading/trailing whitespace and case are ignored, like every other lookup here.

Returns

Material[]

A new array of matches (possibly empty).

Throws

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

Example

import { MaterialLine, materialsInLine } from '@elite-dangerous-almanac/core/materials/materials';

materialsInLine(MaterialLine.Chemical).map((m) => m.grade); // -> [1, 2, 3, 4, 5]
⚠️ **GitHub.com Fallback** ⚠️