cardFromIdfunction
The card a two-character id names, or null. Lower case is read too.
Import it
import { cardFromId } from "@johnmorrisdotca/toranpu/deck";
Definition
function cardFromId(id: string): Card | null
Parameters
| Name | Type | Description |
|---|---|---|
id | string | The physical card id to read. |
Returns
Card | null
The card a two-character id names, or null. Lower case is read too.
Examples
import { cardFromId } from "@johnmorrisdotca/toranpu/deck";
console.log(cardFromId("AS"));{ suit: 'spades', rank: 1 }What it prints (run when this page was built)