Function type for parsing/preprocessing input values before validation. Parsers receive the raw input value and return a preprocessed version that will then be validated by the schema.
const trimParser: Parser = (value) => { return typeof value === 'string' ? value.trim() : value} Copy
const trimParser: Parser = (value) => { return typeof value === 'string' ? value.trim() : value}
Function type for parsing/preprocessing input values before validation. Parsers receive the raw input value and return a preprocessed version that will then be validated by the schema.