contains<T> function
Checks whether the given value contains the item value of type T
Works for iterables and strings
Implementation
IEskValidator contains<T>(T item) => EskValidator((value) {
if (hasContainsProperty(value)) {
return EskResult(
isValid: value.contains(item),
error: 'contains ${pretifyValue(item)}',
value: value,
);
} else {
return EskResult.invalid(
'${value.runtimeType} does not have a length property',
value,
);
}
});