resolveValue<T> function
Validates value
and returns value
or def
.
Implementation
T? resolveValue<T>(T? value,
[T? def, ValueValidator valueValidator = isNotEmptyObject]) {
if (value == null) return def;
var valid = valueValidator(value);
return valid ? value : def;
}