Sort paths before building the tree
Sort paths before building the tree

Deterministically resolve conflicts & add specific keys before wildcards.

Without this patch, a path combination like

  /{something}/else
  /robots.txt

was not accepted, as v8 happens to preserve the order of object keys in this
case, and the wildcard would be added before the fixed value. This would cause
the router to enter the wildcard path when trying to add robots.txt.

With this patch, more specific paths (without wildcards) are built first,
equivalent to:

  /robots.txt
  /{something}/else

wikimedia/hyperswitch