union
DDataParser.union() tries multiple parsers in the provided order and returns the first success. On failure, all issues are aggregated to help with debugging.
Interactive example
Parameters
options: non-empty array of parsers ([DP.string(), DP.number(), ...]).checkers:checkerRefineto apply a rule on the final result (e.g. forbid certain values).errorMessage: custom message when no option matches.
Return value
A DataParserUnion. schema.parse(data) returns DEither.success<OutputUnion> if it finds a match, otherwise DEither.error<DataParserError> containing the errors from each option.
