emittery 0.7.0 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +2 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -31,7 +31,7 @@ function getListeners(instance, eventName) {
31
31
  }
32
32
 
33
33
  function getEventProducers(instance, eventName) {
34
- const key = typeof eventName === 'string' ? eventName : anyProducer;
34
+ const key = typeof eventName === 'string' || typeof eventName === 'symbol' ? eventName : anyProducer;
35
35
  const producers = producersMap.get(instance);
36
36
  if (!producers.has(key)) {
37
37
  producers.set(key, new Set());
@@ -313,7 +313,7 @@ class Emittery {
313
313
  eventNames = Array.isArray(eventNames) ? eventNames : [eventNames];
314
314
 
315
315
  for (const eventName of eventNames) {
316
- if (typeof eventName === 'string') {
316
+ if (typeof eventName === 'string' || typeof eventName === 'symbol') {
317
317
  getListeners(this, eventName).clear();
318
318
 
319
319
  const producers = getEventProducers(this, eventName);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "emittery",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "description": "Simple and modern async event emitter",
5
5
  "license": "MIT",
6
6
  "repository": "sindresorhus/emittery",