Skip to content

Commit

Permalink
add toJSON check to NodeErrors.isTraversableObject as well
Browse files Browse the repository at this point in the history
  • Loading branch information
netroy committed Nov 2, 2022
1 parent 6c60c72 commit b0e2b18
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/workflow/src/NodeErrors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,12 @@ abstract class NodeError extends ExecutionBaseError {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
protected isTraversableObject(value: any): value is JsonObject {
return (
value &&
typeof value === 'object' &&
!Array.isArray(value) &&
typeof value.toJSON !== 'function' &&
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
value && typeof value === 'object' && !Array.isArray(value) && !!Object.keys(value).length
!!Object.keys(value).length
);
}

Expand Down

0 comments on commit b0e2b18

Please sign in to comment.