Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Router.hasRoute was failing to match routes that contained query params. Since Router only really deals with paths this seems kinda broken. Added Y.Router.removeQuery & .hasRoute now uses it. ._getPath should probably use it too but I'm not 100% convinced that's the right choice. Router was generating bad regexes for :foo if it was the last thing in the regex. It would also end up matching hash/query params. Changed the regex so it stops at "/", "?", or "#". Added test for regex generation and threw a ton of paths at it. There's probably some wild edge cases I didn't think of but this seems like a good start.
- Loading branch information
Showing
2 changed files
with
86 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters