ability to search for ts - not obvious
This commit is contained in:
parent
e0508c8883
commit
bebc76092f
|
@ -135,6 +135,11 @@ function fuzzyLookup<S extends T.DictionaryEntry>({ searchString, language, page
|
||||||
tpFilter?: (e: T.DictionaryEntry) => e is S,
|
tpFilter?: (e: T.DictionaryEntry) => e is S,
|
||||||
}): S[] {
|
}): S[] {
|
||||||
// TODO: Implement working with both
|
// TODO: Implement working with both
|
||||||
|
if (Number(searchString)) {
|
||||||
|
const entry = dictionary.findOneByTs(Number(searchString));
|
||||||
|
// @ts-ignore;
|
||||||
|
return entry ? [entry] : [] as S[];
|
||||||
|
}
|
||||||
return language === "Pashto"
|
return language === "Pashto"
|
||||||
? pashtoFuzzyLookup({ searchString, page, tpFilter })
|
? pashtoFuzzyLookup({ searchString, page, tpFilter })
|
||||||
: englishLookup({ searchString, page, tpFilter })
|
: englishLookup({ searchString, page, tpFilter })
|
||||||
|
|
Loading…
Reference in New Issue