@nxtedition/lib 20.4.5 → 20.4.6

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/package.json +1 -1
  2. package/serializers.js +9 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxtedition/lib",
3
- "version": "20.4.5",
3
+ "version": "20.4.6",
4
4
  "license": "MIT",
5
5
  "author": "Robert Nagy <robert.nagy@boffins.se>",
6
6
  "type": "module",
package/serializers.js CHANGED
@@ -207,7 +207,11 @@ function errSerializer(err) {
207
207
  if (!Object.prototype.hasOwnProperty.call(val, seen)) {
208
208
  _err[key] = errSerializer(val)
209
209
  }
210
- } else if (val != null) {
210
+ } else if (
211
+ val != null &&
212
+ key[0] !== key[0].toUpperCase() &&
213
+ (key !== 'emitter' || typeof val !== 'object')
214
+ ) {
211
215
  _err[key] = val
212
216
  }
213
217
  }
@@ -221,6 +225,10 @@ function errSerializer(err) {
221
225
  _err.body = JSON.stringify(_err.body, undefined, 2)
222
226
  }
223
227
 
228
+ if (_err.meta != null && typeof _err.meta !== 'string') {
229
+ _err.meta = JSON.stringify(_err.meta, undefined, 2)
230
+ }
231
+
224
232
  if (_err.code != null && typeof _err.code !== 'string') {
225
233
  _err.code = String(_err.code)
226
234
  }