@@ -67,6 +67,7 @@ import { UntypedFirestoreDataConverter } from '../../src/api/user_data_reader';
67
67
import { isPartialObserver , PartialObserver } from '../../src/api/observer' ;
68
68
import { isPlainObject } from '../../src/util/input_validation' ;
69
69
import { Compat } from '../../src/compat/compat' ;
70
+ import { validateSetOptions } from '../../src/api/database' ;
70
71
71
72
export { GeoPoint , Timestamp } from '../index' ;
72
73
export { FieldValue } from '../../src/compat/field_value' ;
@@ -189,6 +190,7 @@ export class Transaction
189
190
options ?: legacy . SetOptions
190
191
) : Transaction {
191
192
if ( options ) {
193
+ validateSetOptions ( 'Transaction.set' , options ) ;
192
194
this . _delegate . set ( documentRef . _delegate , unwrap ( data ) , options ) ;
193
195
} else {
194
196
this . _delegate . set ( documentRef . _delegate , unwrap ( data ) ) ;
@@ -241,6 +243,7 @@ export class WriteBatch
241
243
options ?: legacy . SetOptions
242
244
) : WriteBatch {
243
245
if ( options ) {
246
+ validateSetOptions ( 'WriteBatch.set' , options ) ;
244
247
this . _delegate . set ( documentRef . _delegate , unwrap ( data ) , options ) ;
245
248
} else {
246
249
this . _delegate . set ( documentRef . _delegate , unwrap ( data ) ) ;
@@ -320,6 +323,7 @@ export class DocumentReference<T = legacy.DocumentData>
320
323
321
324
set ( data : Partial < T > , options ?: legacy . SetOptions ) : Promise < void > {
322
325
if ( options ) {
326
+ validateSetOptions ( 'DocumentReference.set' , options ) ;
323
327
return setDoc ( this . _delegate , unwrap ( data ) , options ) ;
324
328
} else {
325
329
return setDoc ( this . _delegate , unwrap ( data ) ) ;
0 commit comments