validator method

  1. @override
EskResult validator(
  1. dynamic value
)
override

Validates the given value and returns the result.

Don't call directly, call validate instead.

Implementation

@override
EskResult validator(dynamic value) {
  final superRes = super.validator(value);
  if (superRes.isNotValid) return superRes;

  for (var validator in validators) {
    final result = validator.validate(value);
    if (result.isNotValid) {
      return result;
    }
  }

  return EskResult.valid(value);
}