Reference · Rockets, variants, parts and the fit check
spinOffunction
A spin from the spin and way attributes: a name, or seconds a turn. A nonsense value is the default, and a negative one is none.
Import it
import { spinOf } from "@johnmorrisdotca/uchusen-rockets";
Definition
function spinOf(spin: string | null, way: string | null): Spin
Parameters
| Name | Type | Description |
|---|---|---|
spin | string | null | The |
way | string | null | The |
Returns
Spin
The spin to use.
Examples
import { spinOf } from "@johnmorrisdotca/uchusen-rockets";
console.log(spinOf("fast", null), spinOf("30", "ccw"), spinOf("nonsense", null));{ seconds: 20, way: 'cw' } { seconds: 30, way: 'ccw' } { seconds: 180, way: 'cw' }What it prints (run when this page was built)