Reference · Rockets, variants, parts and the fit check
besideCraftfunction
The craft that stand beside a rocket, from the element's beside attribute: on is Starship with Super Heavy (never beside Starship itself), and a list such as saturn-v:saturn-v,iss:iss is those craft, at most seven, each a rocket and a variant (the rocket's default variant when none is given). Anything that is not a craft is left out.
Import it
import { besideCraft } from "@johnmorrisdotca/uchusen-rockets";
Definition
function besideCraft(value: string | null | undefined, rocket: string): Description[]
Parameters
| Name | Type | Description |
|---|---|---|
value | string | null | undefined | The attribute's value. |
rocket | string | The rocket on screen. |
Returns
Description[]
The craft that stand beside it, in order from the left.
Examples
import { besideCraft } from "@johnmorrisdotca/uchusen-rockets";
console.log(besideCraft("saturn-v:saturn-v,iss:iss,hubble:hubble", "starship").map((craft) => craft.rocket), besideCraft("on", "starship"));[ 'saturn-v', 'iss', 'hubble' ] []What it prints (run when this page was built)