Function that either transforms a token to a result value or returns undefined
.
Optional
onEnd: (data: Data<TToken, TOptions>, i: number) => voidOptional function to be called if there are no tokens left. It can be used to throw an error when required token is missing.
Make a parser based on a token-to-value function.
Nonmatch is produced if
undefined
value is returned by a function or if there are no tokens left.Use make if you want to produce a value without consuming a token.
You can use satisfy if you just want to test but not transform the value.