Skip to content

Commit 0b2e9a2

Browse files
committed
NOT SUPPORTED constant
1 parent 6388f7f commit 0b2e9a2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/firestore/src/api/snapshot.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ import { AutoId } from '../util/misc';
5858
import { Firestore } from './database';
5959
import { 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

Comments
 (0)