UNPKG
is-shallow-equal
Version:
latest (1.0.1)
1.0.1
1.0.0
Shallowly compares two objects
github.com/vesparny/is-shallow-equal
vesparny/is-shallow-equal
is-shallow-equal
/
index.js
7 lines
(6 loc)
•
191 B
JavaScript
View Raw
1
2
3
4
5
6
7
module
.
exports
= function
isShallowEqual
(a, b)
{
if
(a === b)
return
true
for
(
var
i in a)
if
(!(i in b))
return
false
for
(
var
i in b)
if
(a[i] !== b[i])
return
false
return
true
}