| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 |
|
| 11 |
|
| 12 | function createRSCRouteModules(payload) {
|
| 13 | const routeModules = {};
|
| 14 | for (const match of payload.matches) populateRSCRouteModules(routeModules, match);
|
| 15 | return routeModules;
|
| 16 | }
|
| 17 | function populateRSCRouteModules(routeModules, matches) {
|
| 18 | matches = Array.isArray(matches) ? matches : [matches];
|
| 19 | for (const match of matches) routeModules[match.id] = {
|
| 20 | links: match.links,
|
| 21 | meta: match.meta,
|
| 22 | default: noopComponent
|
| 23 | };
|
| 24 | }
|
| 25 | const noopComponent = () => null;
|
| 26 |
|
| 27 | export { createRSCRouteModules, populateRSCRouteModules };
|