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.
- package/index.js +6 -1
- package/package.json +1 -1
- 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
|
-
|
|
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