@@ -548,8 +548,8 @@ export function getDoc<T>(
548
548
) : Promise < firestore . DocumentSnapshot < T > > {
549
549
const ref = cast < DocumentReference < T > > ( reference , DocumentReference ) ;
550
550
551
- const datastore = getDatastore ( ref . firestore ) ;
552
- return invokeBatchGetDocumentsRpc ( datastore , [ ref . _key ] ) . then ( result => {
551
+ const datastore = getDatastore ( ref . firestore ) ;
552
+ return invokeBatchGetDocumentsRpc ( datastore , [ ref . _key ] ) . then ( result => {
553
553
hardAssert ( result . length === 1 , 'Expected a single document result' ) ;
554
554
const maybeDocument = result [ 0 ] ;
555
555
return new DocumentSnapshot < T > (
@@ -567,7 +567,7 @@ export function getDocs<T>(
567
567
const queryImpl = cast < Query < T > > ( query , Query ) ;
568
568
validateHasExplicitOrderByForLimitToLast ( queryImpl . _query ) ;
569
569
570
- const datastore = getDatastore ( queryImpl . firestore ) ;
570
+ const datastore = getDatastore ( queryImpl . firestore ) ;
571
571
return invokeRunQueryRpc ( datastore , queryImpl . _query ) . then ( result => {
572
572
const docs = result . map (
573
573
doc =>
@@ -621,10 +621,10 @@ export function setDoc<T>(
621
621
options
622
622
) ;
623
623
624
- const datastore = getDatastore ( ref . firestore ) ;
625
- return invokeCommitRpc (
626
- datastore ,
627
- parsed . toMutations ( ref . _key , Precondition . none ( ) )
624
+ const datastore = getDatastore ( ref . firestore ) ;
625
+ return invokeCommitRpc (
626
+ datastore ,
627
+ parsed . toMutations ( ref . _key , Precondition . none ( ) )
628
628
) ;
629
629
}
630
630
@@ -669,22 +669,21 @@ export function updateDoc(
669
669
) ;
670
670
}
671
671
672
- const datastore = getDatastore ( ref . firestore ) ;
673
- return invokeCommitRpc (
674
- datastore ,
675
- parsed . toMutations ( ref . _key , Precondition . exists ( true ) )
672
+ const datastore = getDatastore ( ref . firestore ) ;
673
+ return invokeCommitRpc (
674
+ datastore ,
675
+ parsed . toMutations ( ref . _key , Precondition . exists ( true ) )
676
676
) ;
677
677
}
678
678
679
679
export function deleteDoc (
680
680
reference : firestore . DocumentReference
681
681
) : Promise < void > {
682
682
const ref = cast < DocumentReference < unknown > > ( reference , DocumentReference ) ;
683
- const datastore = getDatastore ( ref . firestore ) ;
684
- return invokeCommitRpc ( datastore , [
685
- new DeleteMutation ( ref . _key , Precondition . none ( ) )
686
- ]
687
- ) ;
683
+ const datastore = getDatastore ( ref . firestore ) ;
684
+ return invokeCommitRpc ( datastore , [
685
+ new DeleteMutation ( ref . _key , Precondition . none ( ) )
686
+ ] ) ;
688
687
}
689
688
690
689
export function addDoc < T > (
@@ -706,12 +705,11 @@ export function addDoc<T>(
706
705
{ }
707
706
) ;
708
707
709
- const datastore = getDatastore ( collRef . firestore ) ;
710
- return invokeCommitRpc (
711
- datastore ,
712
- parsed . toMutations ( docRef . _key , Precondition . exists ( false ) )
713
- )
714
- . then ( ( ) => docRef ) ;
708
+ const datastore = getDatastore ( collRef . firestore ) ;
709
+ return invokeCommitRpc (
710
+ datastore ,
711
+ parsed . toMutations ( docRef . _key , Precondition . exists ( false ) )
712
+ ) . then ( ( ) => docRef ) ;
715
713
}
716
714
717
715
export function refEqual < T > (
0 commit comments