Skip to content

Commit

Permalink
fix(encodeGeoDocument): clone object instead of mutating original, fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelSolati committed Jun 27, 2020
1 parent 5eeebc6 commit b6f64e7
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,11 +223,13 @@ export function encodeGeoDocument(
lat: geopoint.latitude,
lng: geopoint.longitude,
});
(documentData as GeoFirestoreTypes.GeoDocumentData).g = {
geopoint,
geohash,
return {
...documentData,
g: {
geopoint,
geohash,
},
};
return documentData as GeoFirestoreTypes.GeoDocumentData;
}

/**
Expand Down

0 comments on commit b6f64e7

Please sign in to comment.