Skip to content

astro.Function.parseSystemName

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

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

Function: parseSystemName()

parseSystemName(name): SystemNameParts | null

Defined in: src/astro/system-name.ts:155

Parse a procedural system name into its parts.

The region name may itself contain digits (Col 285 Sector), so parsing walks the suffix backwards from the end. Returns null for anything that is not a well-formed procedural system name.

Parameters

name

string

A system name in any casing, with optional surrounding whitespace, e.g. blae eock kc-c d0.

Returns

SystemNameParts | null

The parsed parts, or null if the name is malformed. A nullish name answers null too: this parser tolerates an absent name, deliberately, so a caller can hand it a field that may not be there. ProceduralSystem.fromName is the stricter factory over the same grammar — it throws TypeError for anything but a string.

Remarks

Surrounding whitespace is trimmed off the name before it is parsed, so it never reaches regionName either (parseSystemName(' synuefe … ').regionName === 'synuefe'). Beyond that, parsing does not canonicalize casing: regionName is captured verbatim from the input. The letters and mass code become numeric indices, so re-formatting them is always canonical, but the region is not — use canonicalizeSystemName (or build a ProceduralSystem via ProceduralSystem.fromName) if you need the region re-cased too.

Throws

If name is present and not a string. Tolerating an absent name is not tolerating any value at all: a number where a name belongs is a caller bug, and it is named rather than left to fail on a method it does not have.

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