ensure
Returns a new event definition whose events will first go through the validator before being passed to their target. Events that don't pass the validator won't reach their targets.
Import
Syntax
Parameters
validator
:Validator
The function used to validate the event.
eventDef
:EventDefinition
The event you want to validate.
Validator
Accepts an event or array of events as its sole argument.
Returns
true
if the event is valid.Returns
false
if the event is not valid.
Example
Last updated