validateOrThrow method

Result validateOrThrow(
  1. dynamic value
)

Works the same as validate, validates that a given value is valid, but throws instead if it's not.

Implementation

Result validateOrThrow(dynamic value) {
  final result = validate(value);
  if (result.isNotValid) throw ValidatorFailedException(result);
  return result;
}