Fix lint warnings

This commit is contained in:
Przemek Więch
2026-05-12 00:29:35 +02:00
parent 05da5a5019
commit 20bddfaeb6
6 changed files with 47 additions and 30 deletions

View File

@@ -104,7 +104,7 @@ class LunrSearchIndex implements SearchIndex {
}
private initMultiLingualLunrWithoutTrimmer(
lunrInstance: any,
lunrInstance: lunr.Builder,
languages: string[],
): void {
const pipelineFunctions: PipelineFunction[] = [];
@@ -142,13 +142,16 @@ class LunrSearchIndex implements SearchIndex {
.filter((s) => !!s)
.map((s) => `${s} ${s}*`)
.join(' ');
const results = this.index!.search(query);
const results = this.index.search(query);
return results
.sort(compare)
.slice(0, MAX_RESULTS)
.map((result) => ({
id: result.ref,
indi: this.indiMap.get(result.ref)!,
indi: this.indiMap.get(result.ref) || {
id: result.ref,
firstName: 'INDI NOT FOUND',
},
}));
}
}