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

sameCardfunction

Whether two card objects are the same card.

Import it

import { sameCard } from "@johnmorrisdotca/toranpu/deck";

Definition

function sameCard(a: Card, b: Card): boolean

Parameters

NameTypeDescription
aCard

The first card or value to compare.

bCard

The second card or value to compare.

Returns

boolean

Whether two card objects are the same card.

Examples

import { cardFromId, sameCard } from "@johnmorrisdotca/toranpu/deck";

const card = { suit: "spades", rank: 1 } as const;
console.log(sameCard(card, cardFromId("AS")!));
true

What it prints (run when this page was built)

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