Skip to content

charton API


charton API / @chart-on/ui / index / matchScore

Function: matchScore() ​

matchScore(item, query, options?): number | null

Defined in: core/src/util/text-match.ts:77

How well item matches query: lower is better, null for no match. In order: exact label, keyword or id; label prefix; keyword or id prefix; acronym of the label or a keyword (rsi for "Relative Strength Index"); word prefix; substring; every query word somewhere; with options.typos, one typo in a query of three or more characters; description substring.

Parameters ​

item ​

SearchItem

query ​

string

options? ​

typos? ​

boolean

Returns ​

number | null