From d19106f8053e362b54f558c7fb547c0e19e4a5bd Mon Sep 17 00:00:00 2001 From: Snowflake107 Date: Tue, 6 Apr 2021 21:30:11 +0545 Subject: [PATCH] define custom filters --- src/utils/AudioFilters.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/utils/AudioFilters.ts b/src/utils/AudioFilters.ts index 4c1fa3f..9544903 100644 --- a/src/utils/AudioFilters.ts +++ b/src/utils/AudioFilters.ts @@ -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)); } };