define custom filters

This commit is contained in:
Snowflake107 2021-04-06 21:30:11 +05:45
parent c1a8de52f3
commit d19106f805

View file

@ -51,6 +51,16 @@ const FilterList = {
.filter((predicate) => typeof predicate === 'string')
.map((m) => this[m])
.join(',');
},
define(filterName: string, value: string) {
/* @ts-ignore */
if (typeof this[filterName] !== "string") return;
/* @ts-ignore */
this[filterName] = value;
},
defineBulk(filterArray: { name: string, value: string }[]) {
filterArray.forEach(arr => this.define(arr.name, arr.value));
}
};