Skip to content

Commit a013a28

Browse files
fix(src): replace ==/!= with ===/!== (#140)
Sources such as [D. Crockford][^1] and [MDN][^2] both advise that only triple equals operator should be used when programming in JavaScript and double equals operator be ignored altogether. [^1]: https://bytearcher.com/articles/douglas-crockford-javascript-good-parts-book-review/ [^2]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Equality_comparisons_and_sameness#Loose_equality_using Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
1 parent 7864fa0 commit a013a28

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ export function objectsEqualShallow(
130130
o1: Record<string, number | RegExp> | null | undefined,
131131
o2: Record<string, number | RegExp> | null | undefined
132132
): boolean {
133-
if (o1 == null || o2 == null) {
133+
if (o1 === null || o2 === null) {
134134
// Null is only equal to null, and undefined to undefined.
135135
return o1 === o2;
136136
}

0 commit comments

Comments
 (0)