Matching, sorting, and encoding – oh, my!
If you’re unfamiliar with the ins and outs of SvelteKit’s more advanced routing techniques, it can quickly become unwieldy. To get ahead of the unexpected, we’re going to look at a few more strategies you can use to ensure your application’s routing works as you intend it to. In this section, we will cover how you can ensure that parameters are of the type you’re expecting them to be. We’ll then examine how SvelteKit handles URLs that can resolve to multiple routes. We’ll wrap it up with a bit of information about encoding URLs. You can expect to see the following sub-sections:
- Matching
- Sorting
- Encoding
Once finished, you’ll be one step closer to mastering the routing of SvelteKit apps.
Matching
We’ve looked at how we can use optional and rest parameters in our routes. But think back to the example we created in Chapter 4 dealing with dynamic...