mirror of
https://github.com/PeWu/topola-viewer.git
synced 2026-10-27 08:04:08 +00:00
Improve code quality
Fix lint warnings
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user