cannotBeEmpty<T> function
Implementation
Rule<T> cannotBeEmpty<T>(
String? Function(T? object) mapper,
String field,
String message,
) {
return Rule<T>(
Reason(field, message),
(object) => mapper(object)?.isNotEmpty ?? false,
);
}