Skip to content

astro.Function.tryToSystemAddress

github-actions[bot] edited this page Aug 26, 2026 · 74 revisions

@elite-dangerous-almanac/core / astro / tryToSystemAddress

Function: tryToSystemAddress()

tryToSystemAddress(address): bigint | null

Defined in: src/astro/system-address-input.ts:51

Convert a supported address representation to a bigint, without accepting a value that may already have lost precision.

Parameters

address

SystemAddressInput

A bigint, a non-negative safe-integer number (a normally parsed journal address), or a decimal digit string.

Returns

bigint | null

The address as a bigint, or null when the input cannot be converted to one: a non-integer or unsafe number (beyond 2^53 - 1, where the value has already been rounded), a negative number, or a string that is not all decimal digits. A bigint always passes through unchanged — whether it fits the 64-bit address layout is the decoder's RangeError to raise, not a conversion failure.

Example

import { tryToSystemAddress } from '@elite-dangerous-almanac/core/astro/system-address-input';

tryToSystemAddress(10477373803);   // -> 10477373803n
tryToSystemAddress('10477373803'); // -> 10477373803n
tryToSystemAddress(1.5);           // -> null

API

Guides
astro
Classes (1)
ProceduralSystem

Properties

Accessors

Methods

Interfaces (16)
Type Aliases (3)
Variables (11)
Functions (37)
Subpath modules (3)
commodities
Interfaces (1)
Type Aliases (1)
Variables (3)
Functions (3)
equipment
Interfaces (6)
Type Aliases (8)
Variables (3)
Functions (10)
Subpath modules (2)
i18n
Interfaces (1)
Type Aliases (1)
Functions (17)
materials
Enumerations (2)
Interfaces (2)
Type Aliases (2)
Variables (9)
Functions (9)
ships
Classes (3)
BuildMetrics

Methods

LoadoutEditError

Constructors

Properties

Methods

ShipLoadout

Accessors

Methods

Interfaces (125)
Type Aliases (44)
Variables (10)
Functions (85)
Subpath modules (8)

Clone this wiki locally