eventemitter2
Advanced tools
Comparing version 6.0.0 to 6.1.0
@@ -9,2 +9,7 @@ # Change Log | ||
## [6.1.0] - 2020-03-19 | ||
### Added | ||
- `ignoreErrors` errors option in constructor @DigitalBrainJS | ||
## [5.0.1] - 2018-01-09 | ||
@@ -11,0 +16,0 @@ |
@@ -27,3 +27,8 @@ export type eventNS = string[]; | ||
*/ | ||
verboseMemoryLeak?: boolean; | ||
verboseMemoryLeak?: boolean | ||
/** | ||
* @default false | ||
* @description disable throwing uncaughtException if an error event is emitted and it has no listeners | ||
*/ | ||
ignoreErrors?: boolean | ||
} | ||
@@ -30,0 +35,0 @@ export interface Listener { |
@@ -33,2 +33,3 @@ /*! | ||
conf.verboseMemoryLeak && (this.verboseMemoryLeak = conf.verboseMemoryLeak); | ||
conf.ignoreErrors && (this.ignoreErrors = conf.ignoreErrors); | ||
@@ -398,3 +399,3 @@ if (this.wildcard) { | ||
return true; | ||
} else if (!this._all && type === 'error') { | ||
} else if (!this.ignoreErrors && !this._all && type === 'error') { | ||
if (arguments[1] instanceof Error) { | ||
@@ -405,3 +406,2 @@ throw arguments[1]; // Unhandled 'error' event | ||
} | ||
return false; | ||
} | ||
@@ -501,3 +501,3 @@ | ||
} | ||
} else if (!this._all && type === 'error') { | ||
} else if (!this.ignoreErrors && !this._all && type === 'error') { | ||
if (arguments[1] instanceof Error) { | ||
@@ -504,0 +504,0 @@ return Promise.reject(arguments[1]); // Unhandled 'error' event |
{ | ||
"name": "eventemitter2", | ||
"version": "6.0.0", | ||
"version": "6.1.0", | ||
"description": "A Node.js event emitter implementation with namespaces, wildcards, TTL and browser support.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -57,3 +57,8 @@ [![Codeship](https://img.shields.io/codeship/3ad58940-4c7d-0131-15d5-5a8cd3f550f8.svg?maxAge=2592000)]() | ||
// | ||
verboseMemoryLeak: false | ||
verboseMemoryLeak: false, | ||
// | ||
// disable throwing uncaughtException if an error event is emitted and it has no listeners | ||
// | ||
ignoreErrors: false | ||
}); | ||
@@ -60,0 +65,0 @@ ``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
39476
741
354