isLte function

Validator isLte(
  1. num max
)

Checks whether the given value is less than or equal max

Implementation

Validator isLte(num max) {
  return and(
    isType<num>(),
    (value) => Result(
      isValid: value <= max,
      expected: 'less than or equal to $max',
      value: value,
    ),
  );
}