When a regex contains a question mark (for instance, for an optional parameter, a negative lookahead, or a non-capturing group), the children of the route are not correctly sorted anymore, because they're cut off at the first question mark. This change removes the content of the regex before sorting.
Additionally, I've changed the test command to ensure it runs on Windows as well.
Great find, going to merge and release. I'll probably re-visit the sorting solution at some point so that the number of segments comes from path-parser. But will do for now 👍
When a regex contains a question mark (for instance, for an optional parameter, a negative lookahead, or a non-capturing group), the children of the route are not correctly sorted anymore, because they're cut off at the first question mark. This change removes the content of the regex before sorting.
Additionally, I've changed the test command to ensure it runs on Windows as well.