emittery 0.10.1 → 0.10.2

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 (3) hide show
  1. package/index.js +6 -1
  2. package/package.json +1 -1
  3. package/readme.md +1 -1
package/index.js CHANGED
@@ -216,7 +216,12 @@ class Emittery {
216
216
 
217
217
  if (!this.debug.logger) {
218
218
  this.debug.logger = (type, debugName, eventName, eventData) => {
219
- eventData = JSON.stringify(eventData);
219
+ try {
220
+ // TODO: Use https://github.com/sindresorhus/safe-stringify when the package is more mature. Just copy-paste the code.
221
+ eventData = JSON.stringify(eventData);
222
+ } catch {
223
+ eventData = `Object with the following keys failed to stringify: ${Object.keys(eventData).join(',')}`;
224
+ }
220
225
 
221
226
  if (typeof eventName === 'symbol') {
222
227
  eventName = eventName.toString();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "emittery",
3
- "version": "0.10.1",
3
+ "version": "0.10.2",
4
4
  "description": "Simple and modern async event emitter",
5
5
  "license": "MIT",
6
6
  "repository": "sindresorhus/emittery",
package/readme.md CHANGED
@@ -89,7 +89,7 @@ Configure the new instance of Emittery.
89
89
 
90
90
  ##### debug?
91
91
 
92
- Type: `objcect`
92
+ Type: `object`
93
93
 
94
94
  Configure the debugging options for this instance.
95
95