Skip to content

Commit 0e936f8

Browse files
authored
Replace ternary operator on cycles checking with short-circuit OR operator (#22)
1 parent fce4043 commit 0e936f8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export default function diff(
3838
newObjKey &&
3939
areObjects &&
4040
!richTypes[Object.getPrototypeOf(objKey).constructor.name] &&
41-
(options.cyclesFix ? !_stack.includes(objKey) : true)
41+
(!options.cyclesFix || !_stack.includes(objKey))
4242
) {
4343
const nestedDiffs = diff(
4444
objKey,

0 commit comments

Comments
 (0)