verify<ErrorType extends ValidationError> method

Either<List<ErrorType>, T> verify<ErrorType extends ValidationError>(
  1. S subject
)

Runs the validator on the supplied subject.

When supplied a type parameter the error list will be filtered to all errors that have the given type.

Implementation

Either<List<ErrorType>, T> verify<ErrorType extends ValidationError>(
  S subject,
) {
  return this(subject).leftMap((errors) {
    final Iterable<ErrorType> filtered = errors.whereType();
    return filtered.toList();
  });
}