nanostores / router

A tiny (673 bytes) router for Nano Stores state manager
MIT License
246 stars 19 forks source link

Fix regular expression for optional params #32

Closed easing closed 7 months ago

easing commented 7 months ago

The router converts patterns with optional parameters to regular expressions that are not strict enough.

Example: /profile/:id?/:tab? matches /profile-random-bug, /profile// and /profile/// paths.

This PR fixes it.

11 bytes added.

ai commented 7 months ago

Thanks a lot!

ai commented 7 months ago

Released in 0.14.2