Reference · Collections and piles: pure helpers
isCardfunction
Whether an item is a card: anything that does not say it is an object. Only a card turns, has a back and lands turned over.
Import it
import { isCard } from "@johnmorrisdotca/fuda-cards/collection";
Definition
function isCard(card: Pick<CollectionCard, "kind">): boolean
Parameters
| Name | Type | Description |
|---|---|---|
card | Pick<CollectionCard, "kind"> | The item, or anything with its |
Returns
boolean
true for a card, false for an object.
Examples
import { isCard } from "@johnmorrisdotca/fuda-cards/collection";
console.log(isCard({}), isCard({ kind: "object" })); // true falsetrue falseWhat it prints (run when this page was built)