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 {
6262 /** Returns a JSON-serializable representation of this `VectorValue` instance. */
6363 toJSON ( ) : object {
6464 return {
65- type : 'firestore/vectorvalue/1.0' ,
65+ type : VectorValue . _jsonSchemaVersion ,
6666 vectorValues : this . _values
6767 } ;
6868 }
Original file line number Diff line number Diff line change @@ -106,17 +106,17 @@ describe('GeoPoint', () => {
106106 expect ( new GeoPoint ( 1 , 2 ) . toJSON ( ) ) . to . deep . equal ( {
107107 latitude : 1 ,
108108 longitude : 2 ,
109- 'type' : 'firestore/geopoint/1.0'
109+ 'type' : GeoPoint . _jsonSchemaVersion
110110 } ) ;
111111 expect ( new GeoPoint ( 0 , 0 ) . toJSON ( ) ) . to . deep . equal ( {
112112 latitude : 0 ,
113113 longitude : 0 ,
114- 'type' : 'firestore/geopoint/1.0'
114+ 'type' : GeoPoint . _jsonSchemaVersion
115115 } ) ;
116116 expect ( new GeoPoint ( 90 , 180 ) . toJSON ( ) ) . to . deep . equal ( {
117117 latitude : 90 ,
118118 longitude : 180 ,
119- 'type' : 'firestore/geopoint/1.0'
119+ 'type' : GeoPoint . _jsonSchemaVersion
120120 } ) ;
121121 } ) ;
122122 it ( 'fromJSON does not throw' , ( ) => {
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ describe('VectorValue', () => {
2929 } ) ;
3030
3131 it ( 'fromJSON parameter order does not matter' , ( ) => {
32- const type = 'firestore/vectorvalue/1.0' ;
32+ const type = VectorValue . _jsonSchemaVersion ;
3333 const vectorValues = [ 1 , 2 , 3 ] ;
3434 const control = new VectorValue ( vectorValues ) ;
3535
@@ -44,15 +44,15 @@ describe('VectorValue', () => {
4444 } ) ;
4545
4646 it ( 'fromJSON empty array does not throw' , ( ) => {
47- const type = 'firestore/vectorvalue/1.0' ;
47+ const type = VectorValue . _jsonSchemaVersion ;
4848 const vectorValues = [ 1 , 2 , 3 ] ;
4949 expect ( ( ) => {
5050 VectorValue . fromJSON ( { type, vectorValues } ) ;
5151 } ) . to . not . throw ;
5252 } ) ;
5353
5454 it ( 'fromJSON missing fields throws' , ( ) => {
55- const type = 'firestore/vectorvalue/1.0' ;
55+ const type = VectorValue . _jsonSchemaVersion ;
5656 const vectorValues = [ 1 , 2 , 3 ] ;
5757 expect ( ( ) => {
5858 VectorValue . fromJSON ( { type /* missing data */ } ) ;
You can’t perform that action at this time.
0 commit comments