mirror of
https://gitlab.com/PronounsPage/PronounsPage.git
synced 2025-09-22 12:03:25 -04:00
[nouns] filter by ending
This commit is contained in:
parent
7f8cb5acef
commit
1af08d32e0
@ -624,7 +624,12 @@ export class Noun {
|
||||
|
||||
for (let field of ['masc', 'fem', 'neutr', 'mascPl', 'femPl', 'neutrPl']) {
|
||||
for (let value of this[field]) {
|
||||
if (value.toLowerCase().indexOf(filter.toLowerCase()) > -1) {
|
||||
const v = value.toLowerCase();
|
||||
if (filter.startsWith('-') && v.endsWith(filter.substring(1))) {
|
||||
return true;
|
||||
} else if (filter.endsWith('-') && v.startsWith(filter.substring(0, filter.length - 1))) {
|
||||
return true;
|
||||
} else if (v.indexOf(filter.toLowerCase()) > -1) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user