Skip to content

Commit

Permalink
Merge pull request #1 from akosiaris/patch-1
Browse files Browse the repository at this point in the history
Switch type check of "a" in isEqual() to includes()
  • Loading branch information
c0per authored Apr 24, 2023
2 parents 5bfeed3 + a44dc70 commit 32c90c1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export const isEqual = (a: JsonValueType, b: JsonValueType): boolean => {
);
}

if (typeof a in ["number", "boolean", "string"]) return a === b;
if (["number", "boolean", "string"].includes(typeof a)) return a === b;

if (typeof a !== "object") return false; // It shouldn't happen as the type of a is jsonValue
if (typeof b !== "object" || Array.isArray(b) || b === null) return false;
Expand Down

0 comments on commit 32c90c1

Please sign in to comment.