all<T, E> static method

Rule<Iterable<T>, E> all<T, E>(
  1. bool predicate(
    1. T
    ), {
  2. required E error,
})

Validates that all items match the predicate.

CollectionRules.all((tag) => tag.length >= 3, error: 'Tags must be 3+ chars')

Implementation

static Rule<Iterable<T>, E> all<T, E>(
  bool Function(T) predicate, {
  required E error,
}) =>
    PredicateRule(
      predicate: (value) => value.every(predicate),
      error: error,
    );