Closed frenzzy closed 6 years ago
Fix order of context.keys when they preserved from parent routes, i.e. keys order is the same as they appear in a url:
context.keys
const routes = { path: '/foo/:a/:b', action(context) { console.log(context.keys); // now and previously: // [ // { name: 'a', … }, // { name: 'b', … }, // ] }, children: [ { path: '/bar/:c/:d', action(context) { console.log(context.keys); // now: // [ // { name: 'a', … }, // { name: 'b', … }, // { name: 'c', … }, // { name: 'd', … }, // ] // previously: // [ // { name: 'c', … }, // { name: 'd', … }, // { name: 'a', … }, // { name: 'b', … }, // ] }, }, ], };
Coverage remained the same at 100.0% when pulling 625f3e0f5bfc522c7c369a164d8b2a0a910b2e1b on frenzzy:fix-context-keys into 28890a5fdac8ed1e4a87fc6146202fc39b8d1736 on kriasoft:master.
Fix order of
context.keys
when they preserved from parent routes, i.e. keys order is the same as they appear in a url: