@nxtedition/lib 15.0.20 → 15.0.21

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/errors.js CHANGED
@@ -50,6 +50,10 @@ module.exports.serializeError = function serializeError(error) {
50
50
  return serializeError({ message: error })
51
51
  }
52
52
 
53
+ if (Buffer.isBuffer(error)) {
54
+ return null
55
+ }
56
+
53
57
  if (Array.isArray(error)) {
54
58
  const errors = error.map(serializeError).filter(Boolean)
55
59
  return errors.length === 0 ? null : errors.length === 1 ? errors[0] : errors
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxtedition/lib",
3
- "version": "15.0.20",
3
+ "version": "15.0.21",
4
4
  "license": "MIT",
5
5
  "author": "Robert Nagy <robert.nagy@boffins.se>",
6
6
  "files": [
package/serializers.js CHANGED
@@ -32,9 +32,14 @@ module.exports = {
32
32
  err: (err) => {
33
33
  // TODO (fix): Merge with errors/serializeError?
34
34
 
35
+ if (Buffer.isBuffer(err)) {
36
+ err = new Error('unexpected buffer error')
37
+ }
38
+
35
39
  if (Array.isArray(err)) {
36
40
  err = err.length === 1 ? err[0] : new AggregateError(err)
37
41
  }
42
+
38
43
  const ret = serializers.err(err)
39
44
 
40
45
  if (ret.data !== null && typeof ret.data === 'object') {