Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix Typescript delete must be on optional error #89

Merged
merged 4 commits into from
May 3, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix Typescript delete must be on optional error
miklcct committed May 3, 2024
commit 98b3c1af424dadfa8ed80cc5d2b1fa24d1b70778
9 changes: 3 additions & 6 deletions src/gtfs/repository/CIFRepository.ts
Original file line number Diff line number Diff line change
@@ -67,12 +67,9 @@ export class CIFRepository {
`);

// overlay the long and latitude values from configuration
return results.map(stop => {
const [stop_lon, stop_lat] = proj4('EPSG:27700', 'EPSG:4326', [(stop.easting - 10000) * 100, (stop.northing - 60000) * 100]);
stop.stop_lon = stop_lon;
stop.stop_lat = stop_lat;
delete stop.easting;
delete stop.northing;
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]);
});
}