ships.Function.hasPowerGenerationStats - Elite-Dangerous-Almanac/Almanac-Core GitHub Wiki

@elite-dangerous-almanac/core / ships / hasPowerGenerationStats

Function: hasPowerGenerationStats()

hasPowerGenerationStats<T>(module): module is T & PowerGenerationStats

Defined in: src/ships/module-capabilities.ts:151

Test for complete power-generation stats.

Type Parameters

T

T extends OutfittingModuleStats

Parameters

module

T | null | undefined

A catalogue result or custom sparse record, including null.

Returns

module is T & PowerGenerationStats

Whether both fields in PowerGenerationStats are numeric.

Example

import type { OutfittingModule } from '@elite-dangerous-almanac/core/ships/modules';
declare const record: OutfittingModule | null;

import { hasPowerGenerationStats } from '@elite-dangerous-almanac/core/ships/module-capabilities';

if (hasPowerGenerationStats(record)) record.powerCapacity; // MW
⚠️ **GitHub.com Fallback** ⚠️