#14 - non-existing notes are indexed

This commit is contained in:
Simon Cambier
2022-05-17 22:17:43 +02:00
parent 8c99450d3b
commit 5c2033cd06
8 changed files with 124 additions and 32 deletions

View File

@@ -75,7 +75,9 @@ export function parseQuery(
const regex =
/(\S+:'(?:[^'\\]|\\.)*')|(\S+:"(?:[^"\\]|\\.)*")|(-?"(?:[^"\\]|\\.)*")|(-?'(?:[^'\\]|\\.)*')|\S+|\S+:\S+/g
let match
let count = 0 // TODO: FIXME: this is a hack to avoid infinite loops
while ((match = regex.exec(string)) !== null) {
if (++count > 100) break
let term = match[0]
const sepIndex = term.indexOf(':')