Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 67cf062

Browse files
committed
Replace *all* instances of " with ' when exporting tsv's, not just first
1 parent c16288c commit 67cf062

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ gyms.forEach(gym => {
6060
s2Cell = S2.S2Cell.FromLatLng({lat: gym.point.geometry.coordinates[1], lng: gym.point.geometry.coordinates[0]}, 20),
6161
s2Coords = s2Cell.getCornerLatLngs(),
6262
s2Center = turf.center(turf.featureCollection(s2Coords
63-
.map(latLng => turf.point([latLng.lng, latLng.lat])))),
63+
.map(latLng => turf.point([latLng.lng, latLng.lat])))),
6464
inPark = parkRegions
6565
.some(region => turf.inside(s2Center, region)),
6666
hostedEx = gym.gym.is_ex;
@@ -78,19 +78,19 @@ gyms.forEach(gym => {
7878
});
7979

8080
if (hostedEx && matchingRegions.length > 0) {
81-
exList += `${he.decode(gym.gym.gymName.trim()).replace('"', '\'')}\t${gym.gym.gymInfo.longitude}\t${gym.gym.gymInfo.latitude}\n`;
81+
exList += `${he.decode(gym.gym.gymName.trim()).replace(/"/g, '\'')}\t${gym.gym.gymInfo.longitude}\t${gym.gym.gymInfo.latitude}\n`;
8282
}
8383

8484
if (inPark && matchingRegions.length > 0) {
8585
parkGyms.push(gym.id);
8686

8787
if (!hostedEx) {
88-
parksList += `${he.decode(gym.gym.gymName.trim()).replace('"', '\'')}\t${gym.gym.gymInfo.longitude}\t${gym.gym.gymInfo.latitude}\n`;
88+
parksList += `${he.decode(gym.gym.gymName.trim()).replace(/"/g, '\'')}\t${gym.gym.gymInfo.longitude}\t${gym.gym.gymInfo.latitude}\n`;
8989
}
9090
}
9191

9292
if (!hostedEx && !inPark && matchingRegions.length > 0) {
93-
gymsList += `${he.decode(gym.gym.gymName.trim()).replace('"', '\'')}\t${gym.gym.gymInfo.longitude}\t${gym.gym.gymInfo.latitude}\n`;
93+
gymsList += `${he.decode(gym.gym.gymName.trim()).replace(/"/g, '\'')}\t${gym.gym.gymInfo.longitude}\t${gym.gym.gymInfo.latitude}\n`;
9494
}
9595
});
9696

0 commit comments

Comments
 (0)