events: add hasEventListener util for validate · nodejs/node@e87db6c · GitHub
Skip to content

Commit e87db6c

Browse files
sungpaksmarco-ippolito
authored andcommitted
events: add hasEventListener util for validate
There was some repetitive logics that validated the existence of eventlisteners. We now replace this with a single line of, `hasEventListener(self, type)`. `self` is the object(e.g. EventEmitter) to be checked whether eventlisteners exists or not. `type` is the type of eventlisteners, which can be `undefined` PR-URL: #55230 Reviewed-By: Jason Zhang <xzha4350@gmail.com>
1 parent d69107f commit e87db6c

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

lib/events.js

Lines changed: 12 additions & 12 deletions

0 commit comments

Comments
 (0)