Utility function that provides a bit cleaner interface for running a parser.
Returns undefined in case parser did not match.
Note: this doesn't capture errors thrown during parsing.
Nonmatch is considered a part or normal flow.
Errors mean unrecoverable state and it's up to client code to decide
where to throw errors and how to get back to safe state.
Utility function that provides a bit cleaner interface for running a parser. Returns
undefined
in case parser did not match.Note: this doesn't capture errors thrown during parsing. Nonmatch is considered a part or normal flow. Errors mean unrecoverable state and it's up to client code to decide where to throw errors and how to get back to safe state.
Returns
A matched value or
undefined
in case of nonmatch.