Schema.build.coerce
Validation builder methods that coerce the input value to the target type.
coerce: {
string: (error?: StringConvertible) => StringBuilder;
number: (error?: StringConvertible) => NumberBuilder;
boolean: (error?: StringConvertible) => BooleanBuilder;
date: (error?: StringConvertible) => DateBuilder;
};Instance members
string
Coerces the input to a string usingString().number
Coerces the input to a number usingNumber().boolean
Coerces the input usingBoolean(); note that non-empty strings like"false"becometrue.date
Coerces the input to a Date usingnew Date().
Related
Schema.build static
An object containing functions that create Builder instances for specific types.
