Closed cola119 closed 4 years ago
Thank you for the feature request. We can add a well-defined JSON representation for GeoPoint
and Timestamp
(though not for other classes in the API); this will be fixed in the next release after #3615 is merged.
Also, thanks a lot for a very detailed description!
Thanks! It's a big help.
[REQUIRED] Describe your environment
[REQUIRED] Describe the problem
When stringify
GeoPoint
instance, it becomes like a{_lat: 30, _long: 133}
. The private fields have been exposed and so confusing. For example, in nuxtjs, the data fetched on the server-side is serialized and posted to the client-side. This variable results above and we have to access likegeopoint._lat
instead ofgeopoint.latitude
.So I propose implementing
toJSON
method like below:toJSON behavior reference
What do you think about this proposal?
Steps to reproduce:
Relevant Code:
TS Playground