jesseditson / fs-router

Use the FS as your micro router
BSD 3-Clause "New" or "Revised" License
165 stars 19 forks source link

fixed regex for backslash replacement to replace all backslashes #9

Closed kaoDev closed 6 years ago

kaoDev commented 6 years ago

On windows I just had the error that a path looking like this:

someFolder\%someParam\index

got transformed to this

someFolder/%someParam\index

so only the first backslash got replaced by a normal slash.

The fix is to add a g flag to the replacement regex so that all backslashes match

coveralls commented 6 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling 77e0ab0f8c95ce849a8bd35f78471a40ede9ca07 on kaoDev:fix/backslah-replace into ecc3bddf8ec89c717be95f0aa2c809d2ecaea38b on jesseditson:master.

jesseditson commented 6 years ago

Nice catch!

jesseditson commented 6 years ago

Released here: https://github.com/jesseditson/fs-router/releases/tag/v0.4.1