- action<TToken, TOptions>(f: ((data: Data<TToken, TOptions>, i: number) => void)): Matcher<TToken, TOptions, null>
-
Parameters
-
f: ((data: Data<TToken, TOptions>, i: number) => void)
-
- (data: Data<TToken, TOptions>, i: number): void
-
Parameters
-
data: Data<TToken, TOptions>
-
i: number
Returns void
Returns Matcher<TToken, TOptions, null>
Make a Matcher that always succeeds with
null
value, and performs an action / side effect without consuming input.Use emit or make if you want to produce a result.
Use peek if you want to wrap another parser.