check method

String? check(
  1. String response
)

Implementation

String? check(String response) {
  for (final pattern in blockedPatterns) {
    if (pattern.hasMatch(response)) {
      return 'Matched: ${pattern.pattern}';
    }
  }
  if (maxResponseLength > 0 && response.length > maxResponseLength) {
    return 'Too long';
  }
  for (final validator in customValidators) {
    final error = validator(response);
    if (error != null) return error;
  }
  return null;
}