@@ -58,6 +58,8 @@ import { AutoId } from '../util/misc';
58
58
import { Firestore } from './database' ;
59
59
import { SnapshotListenOptions } from './reference_impl' ;
60
60
61
+ const NOT_SUPPORTED = 'NOT SUPPORTED' ;
62
+
61
63
/**
62
64
* Converter used by `withConverter()` to transform user objects of type
63
65
* `AppModelType` into Firestore data of type `DbModelType`.
@@ -604,7 +606,7 @@ export function documentSnapshotFromJSON<
604
606
converter ?: FirestoreDataConverter < AppModelType , DbModelType >
605
607
) : DocumentSnapshot < AppModelType , DbModelType > {
606
608
if ( validateJSON ( json , DocumentSnapshot . _jsonSchema ) ) {
607
- if ( json . bundle === 'NOT SUPPORTED' ) {
609
+ if ( json . bundle === NOT_SUPPORTED ) {
608
610
throw new FirestoreError (
609
611
Code . INVALID_ARGUMENT ,
610
612
'The provided JSON object was created in a client environment, which is not supported.'
@@ -910,7 +912,7 @@ export function querySnapshotFromJSON<
910
912
converter ?: FirestoreDataConverter < AppModelType , DbModelType >
911
913
) : QuerySnapshot < AppModelType , DbModelType > {
912
914
if ( validateJSON ( json , QuerySnapshot . _jsonSchema ) ) {
913
- if ( json . bundle === 'NOT SUPPORTED' ) {
915
+ if ( json . bundle === NOT_SUPPORTED ) {
914
916
throw new FirestoreError (
915
917
Code . INVALID_ARGUMENT ,
916
918
'The provided JSON object was created in a client environment, which is not supported.'
0 commit comments