Skip to content

Support named parameters with nested routes #5

@TylorS

Description

@TylorS

Basic repeatable code:

const routes = {
 '/:id': {
  "/": id => `${id}`,
  "/profile": id => `${id} profile`
 }
}

const {path, value} = switchPath('/1/profile', routes)

/* actual
path === '/1/profile'
value === '1'
*/

/* expected
path === '/1/profile'
value === '1 profile'
*/

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions