MCPcopy Create free account
hub / github.com/anomalyco/models.dev / normalizeSearchText

Function normalizeSearchText

packages/web/src/index.ts:108–110  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

106}
107
108function normalizeSearchText(value: string) {
109 return value.toLowerCase().replace(/[^a-z0-9]+/g, " ").trim();
110}
111
112function searchFields(item: SearchIndexItem) {
113 return [item.title, item.id, ...item.tokens].filter(Boolean);

Callers 5

scoreTermFunction · 0.85
scoreSearchItemFunction · 0.85
rankSearchItemsFunction · 0.85
appendHighlightedTextFunction · 0.85
renderSearchResultsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected