@nxtedition/lib 19.0.26 → 19.0.27
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 +4 -5
- package/package.json +1 -1
package/errors.js
CHANGED
|
@@ -22,10 +22,9 @@ export function parseError(error) {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
if (Array.isArray(error)) {
|
|
25
|
-
error
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
25
|
+
return error.length > 1
|
|
26
|
+
? new AggregateError(error.map(parseError).filter(Boolean))
|
|
27
|
+
: parseError(error[0])
|
|
29
28
|
}
|
|
30
29
|
|
|
31
30
|
const { msg, message = msg, errors, cause, data, ...properties } = error
|
|
@@ -138,7 +137,7 @@ export function makeMessages(error, options) {
|
|
|
138
137
|
return fp.pipe(
|
|
139
138
|
fp.flattenDeep,
|
|
140
139
|
fp.flatMap((x) => makeMessages(x, options)),
|
|
141
|
-
fp.uniqBy(
|
|
140
|
+
fp.uniqBy(fp.isEqual),
|
|
142
141
|
)(error)
|
|
143
142
|
} else if (Array.isArray(error.messages)) {
|
|
144
143
|
return makeMessages(error.messages, options)
|