Skip to the content

Toranpuトランプ

Use a deck, play eleven games with computers, solve a solitaire, or display cards in your own design.

Toranpu is Japanese for playing cards. About the name

Contents

Reference · Deck tools

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

NameTypeDescription
idstring

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)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/toranpu 2.15.0.