Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (this.config.url) {
event.url = this.config.url
}
event = await (this.config.interactive ? editEvent(event) : Promise.resolve(event))
if (!event) {
cli.info('Event is empty; Aborting dispatch')
return
}
cli.action.start('Dispatching event')
cli.styledHeader('Event')
cli.styledJSON(event)
defaultEventDispatcher.dispatchEvent(event, (resp: any) => {
callback()
cli.action.stop()
if (resp) {
cli.styledHeader('Response')
cli.styledObject(
{
status: resp.statusCode,
headers: resp.headers
},
['status', 'headers']
)
}
})
}
}