@nxtedition/lib 23.3.10 → 23.3.11

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 +17 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxtedition/lib",
3
- "version": "23.3.10",
3
+ "version": "23.3.11",
4
4
  "license": "MIT",
5
5
  "author": "Robert Nagy <robert.nagy@boffins.se>",
6
6
  "type": "module",
package/serializers.js CHANGED
@@ -248,6 +248,8 @@ function errSerializer(err) {
248
248
  if (!Object.prototype.hasOwnProperty.call(val, seen)) {
249
249
  _err[key] = errSerializer(val)
250
250
  }
251
+ } else if (typeof val === 'bigint') {
252
+ _err[key] = `${val.toString()}`
251
253
  } else if (val != null && !/^[A-Z0-9_]+$/.test(key)) {
252
254
  _err[key] = val
253
255
  }
@@ -255,15 +257,27 @@ function errSerializer(err) {
255
257
  }
256
258
 
257
259
  if (_err.data != null && typeof _err.data !== 'string') {
258
- _err.data = JSON.stringify(_err.data, undefined, 2)
260
+ try {
261
+ _err.data = JSON.stringify(_err.data, undefined, 2)
262
+ } catch {
263
+ // Do nothing...
264
+ }
259
265
  }
260
266
 
261
267
  if (_err.body != null && typeof _err.body !== 'string') {
262
- _err.body = JSON.stringify(_err.body, undefined, 2)
268
+ try {
269
+ _err.body = JSON.stringify(_err.body, undefined, 2)
270
+ } catch {
271
+ // Do nothing...
272
+ }
263
273
  }
264
274
 
265
275
  if (_err.meta != null && typeof _err.meta !== 'string') {
266
- _err.meta = JSON.stringify(_err.meta, undefined, 2)
276
+ try {
277
+ _err.meta = JSON.stringify(_err.meta, undefined, 2)
278
+ } catch {
279
+ // Do nothing...
280
+ }
267
281
  }
268
282
 
269
283
  if (_err.code != null && typeof _err.code !== 'string') {