File tree Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ export class VectorValue {
62
62
/** Returns a JSON-serializable representation of this `VectorValue` instance. */
63
63
toJSON ( ) : object {
64
64
return {
65
- type : 'firestore/vectorvalue/1.0' ,
65
+ type : VectorValue . _jsonSchemaVersion ,
66
66
vectorValues : this . _values
67
67
} ;
68
68
}
Original file line number Diff line number Diff line change @@ -106,17 +106,17 @@ describe('GeoPoint', () => {
106
106
expect ( new GeoPoint ( 1 , 2 ) . toJSON ( ) ) . to . deep . equal ( {
107
107
latitude : 1 ,
108
108
longitude : 2 ,
109
- 'type' : 'firestore/geopoint/1.0'
109
+ 'type' : GeoPoint . _jsonSchemaVersion
110
110
} ) ;
111
111
expect ( new GeoPoint ( 0 , 0 ) . toJSON ( ) ) . to . deep . equal ( {
112
112
latitude : 0 ,
113
113
longitude : 0 ,
114
- 'type' : 'firestore/geopoint/1.0'
114
+ 'type' : GeoPoint . _jsonSchemaVersion
115
115
} ) ;
116
116
expect ( new GeoPoint ( 90 , 180 ) . toJSON ( ) ) . to . deep . equal ( {
117
117
latitude : 90 ,
118
118
longitude : 180 ,
119
- 'type' : 'firestore/geopoint/1.0'
119
+ 'type' : GeoPoint . _jsonSchemaVersion
120
120
} ) ;
121
121
} ) ;
122
122
it ( 'fromJSON does not throw' , ( ) => {
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ describe('VectorValue', () => {
29
29
} ) ;
30
30
31
31
it ( 'fromJSON parameter order does not matter' , ( ) => {
32
- const type = 'firestore/vectorvalue/1.0' ;
32
+ const type = VectorValue . _jsonSchemaVersion ;
33
33
const vectorValues = [ 1 , 2 , 3 ] ;
34
34
const control = new VectorValue ( vectorValues ) ;
35
35
@@ -44,15 +44,15 @@ describe('VectorValue', () => {
44
44
} ) ;
45
45
46
46
it ( 'fromJSON empty array does not throw' , ( ) => {
47
- const type = 'firestore/vectorvalue/1.0' ;
47
+ const type = VectorValue . _jsonSchemaVersion ;
48
48
const vectorValues = [ 1 , 2 , 3 ] ;
49
49
expect ( ( ) => {
50
50
VectorValue . fromJSON ( { type, vectorValues } ) ;
51
51
} ) . to . not . throw ;
52
52
} ) ;
53
53
54
54
it ( 'fromJSON missing fields throws' , ( ) => {
55
- const type = 'firestore/vectorvalue/1.0' ;
55
+ const type = VectorValue . _jsonSchemaVersion ;
56
56
const vectorValues = [ 1 , 2 , 3 ] ;
57
57
expect ( ( ) => {
58
58
VectorValue . fromJSON ( { type /* missing data */ } ) ;
You can’t perform that action at this time.
0 commit comments