Per route options would be merged with global options.
This implementation shouldn't break the current usage. I'm planning to update the documentation to explain the usage in another commit if you like the PR.
Coverage increased (+0.05%) to 94.882% when pulling d3a707b104d9f0b1b8980216426e459af678c275 on danielr18:add-support-pathtoregexp-options into 08e8bbeaa76c5ec194abea388a193bedac7f35fc on fridays:master.
true
the route will be case sensitive. (default:false
)false
the trailing slash is optional. (default:false
)false
the path will match at the beginning. (default:true
)Routes can be further customised if we can change the default pathToRegexp options, I'm proposing 2 ways to do that.
1 - Global pathToRegexp options passing them to the
Routes
constructor.This would solve https://github.com/fridays/next-routes/issues/147.
2 - Per route pathToRegexp options passing them to the
add
function.Per route options would be merged with global options.
This implementation shouldn't break the current usage. I'm planning to update the documentation to explain the usage in another commit if you like the PR.