mapbox / shapefile-fairy

I put a zipfile under my pillow and the fairy brought me shapefiles
ISC License
16 stars 6 forks source link

filenames with backslashes don't get sanitized #19

Closed mapsam closed 7 years ago

mapsam commented 7 years ago

Filenames that include backslashes do not get sanitized when you run it through sanitizeName method. For example, the following file name comes out the same:

Input

city\data.shp

Output

city\data.shp
city_data.shp #expected

Currently the name sanitizer replace function only removes instances of \\ double backslashes, but skips on one. An updated regex of /\\/g should do the trick.

regexr of current replace: http://regexr.com/3f8od regexr of updated regex, which finds all backslashes: http://regexr.com/3f8og

cc @GretaCB @amyleew

mapsam commented 7 years ago

The do now!