Reference · Rockets, variants, parts and the fit check
phasePositionfunction
The place on the timeline of a phase by its id, or null for one the flight does not have.
Import it
import { phasePosition } from "@johnmorrisdotca/uchusen-rockets";
Definition
function phasePosition(flight: Flight, id: string | null | undefined): number | null
Parameters
| Name | Type | Description |
|---|---|---|
flight | Flight | A flight. |
id | string | null | undefined | A phase's id, or null or undefined. |
Returns
number | null
The place of that phase on the timeline, or null for an id the flight does not have.
Examples
import { flightOf, phasePosition } from "@johnmorrisdotca/uchusen-rockets";
const flight = flightOf("falcon-9", "block-5");
if (flight) console.log(phasePosition(flight, "nonsense"));nullWhat it prints (run when this page was built)