elementShouldBeCensored static method

bool elementShouldBeCensored(
  1. String foundKey,
  2. List<CensorElement> elementsToCensor
)

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));
}