MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / parseNoteSearchQuery

Function parseNoteSearchQuery

packages/app-core/src/lib/note-search.ts:41–50  ·  view source on GitHub ↗
(query: string)

Source from the content-addressed store, hash-verified

39}
40
41export function parseNoteSearchQuery(query: string): ParsedNoteSearchQuery {
42 const tags: string[] = []
43 const text: string[] = []
44 for (const token of query.split(/\s+/)) {
45 if (!token) continue
46 if (token.startsWith('#') && token.length > 1) tags.push(token.slice(1).toLowerCase())
47 else text.push(token)
48 }
49 return { freeText: text.join(' ').trim(), tagTokens: tags }
50}
51
52function matchesTags(entry: NoteSearchEntry, tagTokens: string[]): boolean {
53 if (tagTokens.length === 0) return true

Callers 3

SearchPaletteFunction · 0.90
searchNoteIndexFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected