I'm struggling with a variation of one of examples from the README:
const { path, value } = switchPath('/1736/home', {
'/bar': 123,
'/:id': {
'/': id => `id is ${id}`,
'/home': 789
}
});
console.log({ path, value });
I was expecting to get:
{ path: '/1736/home', value: 789 }
But I'm getting
{ path: '/1736', value: 'id is 1736' }
Using an older version of switch-path (1.1.0), I'm getting:
{ path: '/1736/home', value: 'id is 1736' }
... also not what I expect.