Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

event-listener-count.js 338B

12345678910111213141516171819202122
  1. /*!
  2. * depd
  3. * Copyright(c) 2015 Douglas Christopher Wilson
  4. * MIT Licensed
  5. */
  6. 'use strict'
  7. /**
  8. * Module exports.
  9. * @public
  10. */
  11. module.exports = eventListenerCount
  12. /**
  13. * Get the count of listeners on an event emitter of a specific type.
  14. */
  15. function eventListenerCount (emitter, type) {
  16. return emitter.listeners(type).length
  17. }