@@ -58,6 +58,8 @@ import { AutoId } from '../util/misc';
5858import { Firestore } from './database' ;
5959import { SnapshotListenOptions } from './reference_impl' ;
6060
61+ const NOT_SUPPORTED = 'NOT SUPPORTED' ;
62+
6163/**
6264 * Converter used by `withConverter()` to transform user objects of type
6365 * `AppModelType` into Firestore data of type `DbModelType`.
@@ -604,7 +606,7 @@ export function documentSnapshotFromJSON<
604606 converter ?: FirestoreDataConverter < AppModelType , DbModelType >
605607) : DocumentSnapshot < AppModelType , DbModelType > {
606608 if ( validateJSON ( json , DocumentSnapshot . _jsonSchema ) ) {
607- if ( json . bundle === 'NOT SUPPORTED' ) {
609+ if ( json . bundle === NOT_SUPPORTED ) {
608610 throw new FirestoreError (
609611 Code . INVALID_ARGUMENT ,
610612 'The provided JSON object was created in a client environment, which is not supported.'
@@ -910,7 +912,7 @@ export function querySnapshotFromJSON<
910912 converter ?: FirestoreDataConverter < AppModelType , DbModelType >
911913) : QuerySnapshot < AppModelType , DbModelType > {
912914 if ( validateJSON ( json , QuerySnapshot . _jsonSchema ) ) {
913- if ( json . bundle === 'NOT SUPPORTED' ) {
915+ if ( json . bundle === NOT_SUPPORTED ) {
914916 throw new FirestoreError (
915917 Code . INVALID_ARGUMENT ,
916918 'The provided JSON object was created in a client environment, which is not supported.'
0 commit comments