define custom filters
This commit is contained in:
parent
c1a8de52f3
commit
d19106f805
1 changed files with 10 additions and 0 deletions
|
@ -51,6 +51,16 @@ const FilterList = {
|
||||||
.filter((predicate) => typeof predicate === 'string')
|
.filter((predicate) => typeof predicate === 'string')
|
||||||
.map((m) => this[m])
|
.map((m) => this[m])
|
||||||
.join(',');
|
.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));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue