@@ -20,7 +20,7 @@ import {
2020 FieldPath as PublicFieldPath ,
2121 SetOptions
2222} from '@firebase/firestore-types' ;
23- import { Compat , getModularInstance } from '@firebase/util' ;
23+ import { Compat , deepEqual , getModularInstance } from '@firebase/util' ;
2424
2525import { ParseContext } from '../api/parse_context' ;
2626import { DatabaseId } from '../core/database_info' ;
@@ -525,13 +525,15 @@ export class ArrayUnionFieldValueImpl extends FieldValue {
525525 }
526526
527527 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+ ) ;
530532 }
531533}
532534
533535export class ArrayRemoveFieldValueImpl extends FieldValue {
534- constructor ( methodName : string , readonly _elements : unknown [ ] ) {
536+ constructor ( methodName : string , private readonly _elements : unknown [ ] ) {
535537 super ( methodName ) ;
536538 }
537539
@@ -549,8 +551,10 @@ export class ArrayRemoveFieldValueImpl extends FieldValue {
549551 }
550552
551553 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+ ) ;
554558 }
555559}
556560
@@ -568,8 +572,10 @@ export class NumericIncrementFieldValueImpl extends FieldValue {
568572 }
569573
570574 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+ ) ;
573579 }
574580}
575581
0 commit comments