JavaScript deepEqual operation for checking nested objects