DEV Community

Discussion on: Build a very basic SPA JavaScript router

Collapse
 
labzdjee profile image
Gérard Gauthier

Well, parseLocation (findComponentByPath uses) transforms any upper case letters to lower case letters, that's why you need the i switch downstream
You could also modify parseLocation
I also noticed \\ as well as gm are unnecessary in the RegExp.