Reference · Game engine and table
isClothfunction
Whether a text names a cloth.
Import it
import { isCloth } from "@johnmorrisdotca/hitotsu";
Definition
function isCloth(text: unknown): text is Cloth
Parameters
| Name | Type | Description |
|---|---|---|
text | unknown | Text to parse, validate or format. |
Returns
boolean
Whether a text names a cloth.
Examples
import { isCloth } from "@johnmorrisdotca/hitotsu";
console.log(isCloth("green"), isCloth("unknown"));true falseWhat it prints (run when this page was built)