Reference · Flags a page registers itself
searchCustomFlagsfunction
Finds registered flags by a word: in the id's slug, the names (English and Japanese) and the group, ignoring case; the best first (exact, then a start, then anywhere), then in the order added.
Import it
import { searchCustomFlags } from "@johnmorrisdotca/hata/custom";
Definition
function searchCustomFlags(query: string): CustomFlagInfo[]
Parameters
| Name | Type | Description |
|---|---|---|
query | string | The words typed; an empty text finds none. |
Returns
CustomFlagInfo[]
The matching flags, as listCustomFlags gives them.
Examples
import { searchCustomFlags } from "@johnmorrisdotca/hata/custom";
console.log(searchCustomFlags("harbour").map((flag) => flag.id));[]What it prints (run when this page was built)