ships.Function.getShipGunsight - Elite-Dangerous-Almanac/Almanac-Core GitHub Wiki
@elite-dangerous-almanac/core / ships / getShipGunsight
getShipGunsight(
shipSymbol):ShipGunsight|null
Defined in: src/ships/gunsights.ts:93
Look up a hull's gunsight by its internal symbol, case-insensitively.
string
Hull symbol, e.g. "SideWinder". Leading/trailing whitespace
and case are ignored.
ShipGunsight | null
The deeply frozen gunsight, or null when the hull is unknown.
If shipSymbol is present and not a string. A nullish value is
a miss, like any other unrecognised symbol.
import { getShipGunsight } from '@elite-dangerous-almanac/core/ships/gunsights';
getShipGunsight(' sidewinder ')?.length; // -> 2
getShipGunsight('not_a_ship'); // -> null