fixup! Extend QueryMatcher's sorting heuristic

This commit is contained in:
Mike Pennisi 2020-06-18 14:20:40 -04:00
parent 4ffc54d143
commit 2e0cb4746a

View File

@ -118,7 +118,7 @@ export default class QueryMatcher<T extends Object> {
const index = resultKey.indexOf(query);
if (index !== -1 && (!this._options.shouldMatchPrefix || index === 0)) {
matches.push(
...candidates.map((candidate) => ({key, index, ...candidate}))
...candidates.map((candidate) => ({index, ...candidate}))
);
}
}