Improve code quality

Fix lint warnings
This commit is contained in:
Przemek Więch
2026-05-10 21:56:51 +02:00
parent ea82bc4c98
commit 8202c9cd05
29 changed files with 315 additions and 221 deletions

View File

@@ -57,7 +57,7 @@ function getHusbandLastName(
}
class LunrSearchIndex implements SearchIndex {
private index: lunr.Index | undefined;
private index!: lunr.Index;
private indiMap: Map<string, JsonIndi>;
private famMap: Map<string, JsonFam>;
@@ -107,7 +107,6 @@ class LunrSearchIndex implements SearchIndex {
lunrInstance: any,
languages: string[],
): void {
let wordCharacters = '';
const pipelineFunctions: PipelineFunction[] = [];
const searchPipelineFunctions: PipelineFunction[] = [];
languages.forEach((language) => {
@@ -115,12 +114,10 @@ class LunrSearchIndex implements SearchIndex {
// @ts-ignore
const lunrLanguage = lunr[language];
if (language === 'en') {
wordCharacters += '\\w';
pipelineFunctions.unshift(lunr.stopWordFilter);
pipelineFunctions.push(lunr.stemmer);
searchPipelineFunctions.push(lunr.stemmer);
} else {
wordCharacters += lunrLanguage.wordCharacters;
if (lunrLanguage.stopWordFilter) {
pipelineFunctions.unshift(lunrLanguage.stopWordFilter);
}