@@ -20,7 +20,7 @@ import {
20
20
FieldPath as PublicFieldPath ,
21
21
SetOptions
22
22
} from '@firebase/firestore-types' ;
23
- import { Compat , getModularInstance } from '@firebase/util' ;
23
+ import { Compat , deepEqual , getModularInstance } from '@firebase/util' ;
24
24
25
25
import { ParseContext } from '../api/parse_context' ;
26
26
import { DatabaseId } from '../core/database_info' ;
@@ -525,13 +525,15 @@ export class ArrayUnionFieldValueImpl extends FieldValue {
525
525
}
526
526
527
527
isEqual ( other : FieldValue ) : boolean {
528
- // TODO(mrschmidt): Implement isEquals
529
- return this === other ;
528
+ return (
529
+ other instanceof ArrayUnionFieldValueImpl &&
530
+ deepEqual ( this . _elements , other . _elements )
531
+ ) ;
530
532
}
531
533
}
532
534
533
535
export class ArrayRemoveFieldValueImpl extends FieldValue {
534
- constructor ( methodName : string , readonly _elements : unknown [ ] ) {
536
+ constructor ( methodName : string , private readonly _elements : unknown [ ] ) {
535
537
super ( methodName ) ;
536
538
}
537
539
@@ -549,8 +551,10 @@ export class ArrayRemoveFieldValueImpl extends FieldValue {
549
551
}
550
552
551
553
isEqual ( other : FieldValue ) : boolean {
552
- // TODO(mrschmidt): Implement isEquals
553
- return this === other ;
554
+ return (
555
+ other instanceof ArrayRemoveFieldValueImpl &&
556
+ deepEqual ( this . _elements , other . _elements )
557
+ ) ;
554
558
}
555
559
}
556
560
@@ -568,8 +572,10 @@ export class NumericIncrementFieldValueImpl extends FieldValue {
568
572
}
569
573
570
574
isEqual ( other : FieldValue ) : boolean {
571
- // TODO(mrschmidt): Implement isEquals
572
- return this === other ;
575
+ return (
576
+ other instanceof NumericIncrementFieldValueImpl &&
577
+ this . _operand === other . _operand
578
+ ) ;
573
579
}
574
580
}
575
581
0 commit comments