(notes: NoteMeta[])
| 22 | const LONG_QUERY_EXACT_FIRST_CHARS = 16 |
| 23 | |
| 24 | export function buildNoteSearchIndex(notes: NoteMeta[]): NoteSearchEntry[] { |
| 25 | return notes.map((note) => { |
| 26 | const tagsLower = note.tags.map((tag) => tag.toLowerCase()) |
| 27 | return { |
| 28 | note, |
| 29 | title: note.title, |
| 30 | titleLower: note.title.toLowerCase(), |
| 31 | path: note.path, |
| 32 | pathLower: note.path.toLowerCase(), |
| 33 | excerpt: note.excerpt, |
| 34 | excerptLower: note.excerpt.toLowerCase(), |
| 35 | tags: tagsLower.join(' '), |
| 36 | tagsLower |
| 37 | } |
| 38 | }) |
| 39 | } |
| 40 | |
| 41 | export function parseNoteSearchQuery(query: string): ParsedNoteSearchQuery { |
| 42 | const tags: string[] = [] |
no outgoing calls
no test coverage detected