Skip to content

Commit

Permalink
combine Object.assign with spread operation
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Tsang committed May 3, 2024
1 parent ffdb727 commit ec5c765
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/gtfs/repository/CIFRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,9 @@ export class CIFRepository {
// overlay the long and latitude values from configuration
return results.map(row => {
const [stop_lon, stop_lat] = proj4('EPSG:27700', 'EPSG:4326', [(row.easting - 10000) * 100, (row.northing - 60000) * 100]);
const {easting, northing, ...stop} = {...row, stop_lon, stop_lat};
return Object.assign(stop, this.stationCoordinates[stop.stop_id]);
// @ts-ignore We are overwriting the lon/lat from this.stationCoordinates
const {easting, northing, ...stop} = {...row, stop_lon, stop_lat, ...this.stationCoordinates[row.stop_id]};
return stop;
});
}

Expand Down

0 comments on commit ec5c765

Please sign in to comment.