const getMappedRendererByPath = (path, routeRendererMap) => { if (!routeRendererMap || typeof routeRendererMap !== "object") { return null; } const routeRenderer = routeRendererMap[path]; return typeof routeRenderer === "function" ? routeRenderer : null; }; const resolveMappedRouteRenderer = (path, routeRendererMaps = []) => { for (const routeRendererMap of routeRendererMaps) { const routeRenderer = getMappedRendererByPath(path, routeRendererMap); if (routeRenderer) { return routeRenderer; } } return null; }; const buildBreadcrumbRendererMaps = ({ simpleRouteRenderersByPath, simpleLinkTextPairRenderersByPath, simpleMyPortalRouteRenderersByPath, newAppealRouteRenderersByPath, callbackRouteRenderersByPath, stepBackRouteRenderersByPath, caseDetailRouteRenderersByPath, detailAndAccountRouteRenderersByPath }) => [ simpleRouteRenderersByPath, simpleLinkTextPairRenderersByPath, simpleMyPortalRouteRenderersByPath, newAppealRouteRenderersByPath, callbackRouteRenderersByPath, stepBackRouteRenderersByPath, caseDetailRouteRenderersByPath, detailAndAccountRouteRenderersByPath ]; module.exports = { buildBreadcrumbRendererMaps, getMappedRendererByPath, resolveMappedRouteRenderer };