isOneOf<T> function
Checks whether the given value is one of the options values of type T
Implementation
IEskValidator isOneOf<T>(List<T> options) => all([
isType<T>(),
EskValidator(
(value) => EskResult(
isValid: options.contains(value),
error: 'one of: ${pretifyValue(options)}',
value: value,
),
),
]);