elementShouldBeCensored static method
Returns true if the given foundKey
exists in the given elementsToCensor
list.
Implementation
static bool elementShouldBeCensored(
String foundKey, List<CensorElement> elementsToCensor) {
return elementsToCensor.isNotEmpty &&
elementsToCensor.any((element) => element.matches(foundKey));
}