Reference · Framing, geometry and quiz tools
featureChosenfunction
Whether a feature is among the choices.
Import it
import { featureChosen } from "@johnmorrisdotca/chizu";
Definition
function featureChosen(feature: Pick<ChizuFeature, "kind" | "group">, choices: readonly ChizuFeatureChoice[]): boolean
Parameters
| Name | Type | Description |
|---|---|---|
feature | Pick<ChizuFeature, "group" | "kind"> | The physical feature being classified or tested. |
choices | readonly ChizuFeatureChoice[] | Native physical-feature groups, kinds, water or all selections. |
Returns
boolean
Whether a feature is among the choices.
Examples
import { featureChosen, type ChizuFeature } from "@johnmorrisdotca/chizu";
const lake = { kind: "lake", group: "lakes" } as Pick<ChizuFeature, "kind" | "group">;
console.log(featureChosen(lake, ["water"]), featureChosen(lake, ["rivers"]), featureChosen(lake, ["lake"]));
// true false truetrue false trueWhat it prints (run when this page was built)