Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
emitAsync(event, a1, a2, a3, a4, a5) {
const prefix = EventEmitter.prefixed;
const evt = prefix ? prefix + event : event;
if (!this._events || !this._events[evt]) {
return Promise.resolve();
}
let i;
const listeners = this._events[evt];
const len = arguments.length;
let args;
if ('function' === typeof listeners.fn) {
if (listeners.once) {
this.removeListener(event, listeners.fn, undefined, true);
}