balazsbotond / urlcat

A URL builder library for JavaScript.
https://urlcat.org
MIT License
1.82k stars 57 forks source link

Merge path param regexes #70

Closed balazsbotond closed 3 years ago

balazsbotond commented 3 years ago

There was a separate regex for matching path parameters in general and for excluding ones that start with a number. I've merged them into a single regex so param names starting with a number aren't even matched in the first place so they won't need to be excluded.

This improves readability by reducing noise and it is also a bit more performant.

I've also added two test cases because this case wasn't covered.