File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change
1
+ /**
2
+ * Given two objects, performs equality by iterating through keys
3
+ * on an object and returning `false` when any key has values which
4
+ * are not strictly equal between `objA` and `objB`.
5
+ * Returns `true` when the values of all keys are strictly equal.
6
+ *
7
+ * @param {Object } objA
8
+ * @param {Object } objB
9
+ * @return {Boolean }
10
+ */
1
11
export default function shallowEqual ( objA , objB ) {
2
12
if ( objA === objB ) {
3
13
return true ;
Original file line number Diff line number Diff line change
1
+ /**
2
+ * Given two objects, performs equality by iterating through keys
3
+ * on an object and returning `false` when any key has values which
4
+ * are not strictly equal between `objA` and `objB`.
5
+ * Returns `true` when the values of all keys are strictly equal.
6
+ *
7
+ * NOTE: if value is an `Object`, returns `false`. This allows the check
8
+ * to be more performant.
9
+ *
10
+ * @param {Object } objA
11
+ * @param {Object } objB
12
+ * @return {Boolean }
13
+ */
1
14
export default function shallowEqualScalar ( objA , objB ) {
2
15
if ( objA === objB ) {
3
16
return true ;
You can’t perform that action at this time.
0 commit comments