change behavior of trie-suggest

This commit is contained in:
Joeri Exelmans 2025-05-10 15:49:59 +02:00
parent 1fa47d4abd
commit a166ebb0d7

View file

@ -153,7 +153,7 @@ const __suggest = (trie, path, remaining, maxSuggestions) => {
return results;
}
const [pos, prefix] = binarySearch(trie.children, remaining);
if (prefix.length === 0) {
if (prefix.length !== remaining.length) {
return [];
}
const [haveKey, haveChildNode] = trie.children[pos];