You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-23 17:02:25 +03:00
fix tests
This commit is contained in:
@@ -102,26 +102,21 @@ export class FilterComponent {
|
|||||||
const name = Object.keys(literalKeys)[n];
|
const name = Object.keys(literalKeys)[n];
|
||||||
const matchFunc = literalKeys[name];
|
const matchFunc = literalKeys[name];
|
||||||
const notName = "not_" + name;
|
const notName = "not_" + name;
|
||||||
const disallowedValues = this[notName];
|
const disallowedValues: string[] = this.filterJson[notName];
|
||||||
if (disallowedValues.filter(matchFunc).length > 0) {
|
if (disallowedValues?.some(matchFunc)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const allowedValues = this[name];
|
const allowedValues: string[] = this.filterJson[name];
|
||||||
if (allowedValues && allowedValues.length > 0) {
|
if (allowedValues && !allowedValues.some(matchFunc)) {
|
||||||
const anyMatch = allowedValues.some(matchFunc);
|
|
||||||
if (!anyMatch) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
const containsUrlFilter = this.filterJson.contains_url;
|
const containsUrlFilter = this.filterJson.contains_url;
|
||||||
if (containsUrlFilter !== undefined) {
|
if (containsUrlFilter !== undefined && containsUrlFilter !== containsUrl) {
|
||||||
if (containsUrlFilter !== containsUrl) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user