toUpperCase function
- IValidator child
Transforms a string to uppercase.
Fails if the input value is not a string.
Passes the uppercase string to the child
validator.
Implementation
IValidator toUpperCase(IValidator child) {
return isString() & transform((v) => v.toUpperCase(), child);
}