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

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

Function: hasShieldRegenerationStats()

hasShieldRegenerationStats<T>(module): module is T & ShieldRegenerationStats

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

Test for both shield regeneration rates.

Type Parameters

T

T extends OutfittingModuleStats

Parameters

module

T | null | undefined

A catalogue result or custom sparse record, including null.

Returns

module is T & ShieldRegenerationStats

Whether both fields in ShieldRegenerationStats are numeric.

Example

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

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

if (hasShieldRegenerationStats(record)) record.shieldRegenRate; // MJ/s
⚠️ **GitHub.com Fallback** ⚠️