maxSize<K, V, E> static method

Rule<Map<K, V>, E> maxSize<K, V, E>(
  1. int max, {
  2. required E error,
})

Validates that the map has at most max entries.

MapRules.maxSize(10, error: 'Maximum 10 entries')

Implementation

static Rule<Map<K, V>, E> maxSize<K, V, E>(int max, {required E error}) =>
    PredicateRule(
      predicate: (value) => value.length <= max,
      error: error,
    );