Skip to content

broken?: Match a route with :param parameters base inside nested configurations #23

@wmaurer

Description

@wmaurer

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions