besideCraft関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
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 { besideCraft } from "@johnmorrisdotca/uchusen-rockets";
定義
function besideCraft(value: string | null | undefined, rocket: string): Description[]
引数
| 名前 | 型 | 説明 |
|---|---|---|
value | string | null | undefined | The attribute's value. |
rocket | string | The rocket on screen. |
戻り値
Description[]
The craft that stand beside it, in order from the left.
例
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' ] []出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。