Reference · Marking, scores and game rules
searchSayingsfunction
The proverbs or compounds that hold a piece of text in their written form, their reading or any of their meanings, ignoring case.
Import it
import { searchSayings } from "@johnmorrisdotca/kotoba";
Definition
function searchSayings(sayings: readonly Saying[], text: string): Saying[]
Parameters
| Name | Type | Description |
|---|---|---|
sayings | readonly Saying[] | The entries to search, from |
text | string | What was typed; blank text matches every entry. |
Returns
Saying[]
The entries that match, in the order given.
Examples
import { readSayings, searchSayings } from "@johnmorrisdotca/kotoba";
import { JA_YOJIJUKUGO } from "@johnmorrisdotca/kotoba/yojijukugo-ja";
console.log(searchSayings(readSayings(JA_YOJIJUKUGO), "two birds")[0]?.saying);一挙両得What it prints (run when this page was built)