repoweaver
Version:
A GitHub App that skillfully weaves multiple templates together to create and update repositories with intelligent merge strategies
1 lines • 2.67 kB
JSON
{"ast":null,"code":"\"use strict\";\n\nexport function checkDuplicateRouteNames(state) {\n const duplicates = [];\n const getRouteNames = (location, state) => {\n state.routes.forEach(route => {\n const currentLocation = location ? `${location} > ${route.name}` : route.name;\n route.state?.routeNames?.forEach(routeName => {\n if (routeName === route.name) {\n duplicates.push([currentLocation, `${currentLocation} > ${route.name}`]);\n }\n });\n if (route.state) {\n getRouteNames(currentLocation, route.state);\n }\n });\n };\n getRouteNames('', state);\n return duplicates;\n}","map":{"version":3,"names":["checkDuplicateRouteNames","state","duplicates","getRouteNames","location","routes","forEach","route","currentLocation","name","routeNames","routeName","push"],"sources":["/Users/pmouli/Documents/GitHub.nosync/boots-strapper/mobile/node_modules/@react-navigation/core/src/checkDuplicateRouteNames.tsx"],"sourcesContent":["import type { NavigationState, PartialState } from '@react-navigation/routers';\n\nexport function checkDuplicateRouteNames(state: NavigationState) {\n const duplicates: string[][] = [];\n\n const getRouteNames = (\n location: string,\n state: NavigationState | PartialState<NavigationState>\n ) => {\n state.routes.forEach((route: (typeof state.routes)[0]) => {\n const currentLocation = location\n ? `${location} > ${route.name}`\n : route.name;\n\n route.state?.routeNames?.forEach((routeName) => {\n if (routeName === route.name) {\n duplicates.push([\n currentLocation,\n `${currentLocation} > ${route.name}`,\n ]);\n }\n });\n\n if (route.state) {\n getRouteNames(currentLocation, route.state);\n }\n });\n };\n\n getRouteNames('', state);\n\n return duplicates;\n}\n"],"mappings":";;AAEA,OAAO,SAASA,wBAAwBA,CAACC,KAAsB,EAAE;EAC/D,MAAMC,UAAsB,GAAG,EAAE;EAEjC,MAAMC,aAAa,GAAGA,CACpBC,QAAgB,EAChBH,KAAsD,KACnD;IACHA,KAAK,CAACI,MAAM,CAACC,OAAO,CAAEC,KAA+B,IAAK;MACxD,MAAMC,eAAe,GAAGJ,QAAQ,GAC5B,GAAGA,QAAQ,MAAMG,KAAK,CAACE,IAAI,EAAE,GAC7BF,KAAK,CAACE,IAAI;MAEdF,KAAK,CAACN,KAAK,EAAES,UAAU,EAAEJ,OAAO,CAAEK,SAAS,IAAK;QAC9C,IAAIA,SAAS,KAAKJ,KAAK,CAACE,IAAI,EAAE;UAC5BP,UAAU,CAACU,IAAI,CAAC,CACdJ,eAAe,EACf,GAAGA,eAAe,MAAMD,KAAK,CAACE,IAAI,EAAE,CACrC,CAAC;QACJ;MACF,CAAC,CAAC;MAEF,IAAIF,KAAK,CAACN,KAAK,EAAE;QACfE,aAAa,CAACK,eAAe,EAAED,KAAK,CAACN,KAAK,CAAC;MAC7C;IACF,CAAC,CAAC;EACJ,CAAC;EAEDE,aAAa,CAAC,EAAE,EAAEF,KAAK,CAAC;EAExB,OAAOC,UAAU;AACnB","ignoreList":[]},"metadata":{"hasCjsExports":false},"sourceType":"module","externalDependencies":[]}