add path-to-regexp support
Closed this issue · 3 comments
fabienjuif commented
fabienjuif commented
Right now the code is of take
helper is :
const take = (match, callback) => (action, tree) => {
const isMatching = false
|| (isString(match) && match === action.fullpath)
|| (isFunction(match) && match(action, tree))
|| (isRegExp(match) && action.fullpath.match(match))
if (isMatching) return callback(action, tree)
return false
}
We are testing match
type from the easiest to test to the hardest.
- How can we test that the string is a
path
type to applypath-to-regexp
? - Should we pass all string to
path-to-regexp
?- Then what about performance ?
fabienjuif commented
wbercx commented
Sorry for the delay.
We could benchmark the different approaches, but I doubt that passing every string to path-to-regexp
would cause any serious bottlenecks. It would be my preferred approach.