add toJSON check to NodeErrors.isTraversableObject as well

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™ 2022-11-02 13:47:43 +01:00
parent 6c60c72934
commit b0e2b188d5

View file

@ -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
);
}