Skip to content

Commit 7a74f0b

Browse files
Associate titles directly with their keys to avoid indexing issues
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent 95d9445 commit 7a74f0b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

js/finder.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ export default class Finder {
2020
private fzf: Fzf<string[]>;
2121

2222
private docs: Record<string, Omit<StoreDoc, 'id' | 'title'>> = {};
23-
private titles: string[] = [];
23+
private titlesByKey: Record<string, string> = {};
2424

2525
constructor(storeDocs: Record<string, StoreDoc>, limit: number) {
2626
for (const [key, { id, title, ...rest }] of Object.entries(storeDocs)) {
27-
this.titles.push(title);
27+
this.titlesByKey[key] = title;
2828
this.docs[key] = rest;
2929
}
3030

0 commit comments

Comments
 (0)