mirror of https://gitgud.io/fatchan/jschan.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
464 B
13 lines
464 B
'use strict';
|
|
|
|
module.exports = (filters, combinedString, strictCombinedString) => {
|
|
|
|
for (const filter of filters) {
|
|
const string = filter.strictFiltering ? strictCombinedString : combinedString;
|
|
const hitFilter = filter.filters.find(match => { return string.includes(match.toLowerCase()); });
|
|
if (hitFilter) {
|
|
return [ hitFilter, filter.filterMode, filter.filterMessage, filter.filterBanDuration, filter.filterBanAppealable ];
|
|
}
|
|
}
|
|
return false;
|
|
};
|
|
|