toUpperCase function

IValidator toUpperCase(
  1. IValidator child, {
  2. String? message,
})

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, {String? message}) {
  final base = isString() & core.transform((v) => v.toUpperCase(), child);
  return core.handleReturnPreserveValue(base, message);
}