@nxtedition/lib 19.0.6 → 19.0.8
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 +3 -3
- package/package.json +1 -1
package/errors.js
CHANGED
|
@@ -133,11 +133,11 @@ export function makeMessages(error, options) {
|
|
|
133
133
|
if (Array.isArray(error)) {
|
|
134
134
|
return fp.pipe(
|
|
135
135
|
fp.flattenDeep,
|
|
136
|
-
fp.flatMap((x) => makeMessages(x,
|
|
136
|
+
fp.flatMap((x) => makeMessages(x, options)),
|
|
137
137
|
fp.uniqBy('id'),
|
|
138
138
|
)(error)
|
|
139
139
|
} else if (Array.isArray(error.messages)) {
|
|
140
|
-
return makeMessages(error.messages,
|
|
140
|
+
return makeMessages(error.messages, options)
|
|
141
141
|
} else if (error) {
|
|
142
142
|
let err
|
|
143
143
|
if (typeof error === 'string' && error) {
|
|
@@ -145,7 +145,7 @@ export function makeMessages(error, options) {
|
|
|
145
145
|
} else if (typeof error === 'object') {
|
|
146
146
|
const level = parseInt(error.level) || options?.level || 50
|
|
147
147
|
const code =
|
|
148
|
-
[error?.code, options?.codes?.[error?.code]].find(
|
|
148
|
+
[error?.code, options?.codes?.[error?.code], options?.code].find(
|
|
149
149
|
(x) => typeof x === 'string' && x.length > 0,
|
|
150
150
|
) ?? undefined
|
|
151
151
|
const msg =
|