diff --git a/src/node_dto.mjs b/src/node_dto.mjs index b03255b..5b33a83 100644 --- a/src/node_dto.mjs +++ b/src/node_dto.mjs @@ -217,8 +217,9 @@ export class NodeDto { } } - if (withErrors.filter((f) => Object.keys(f).length).length) { - return { success: false, errors: withErrors }; + const errors = withErrors.filter((f) => Object.keys(f).length) + if (errors.length) { + return { success: false, errors }; } return {