UNPKG

repoweaver

Version:

A GitHub App that skillfully weaves multiple templates together to create and update repositories with intelligent merge strategies

1 lines 2.52 kB
{"ast":null,"code":"\"use strict\";\n\nimport { CHILD_STATE } from \"./useRouteCache.js\";\nexport function getFocusedRouteNameFromRoute(route) {\n const state = route[CHILD_STATE] ?? route.state;\n const params = route.params;\n const routeName = state ? state.routes[state.index ?? (typeof state.type === 'string' && state.type !== 'stack' ? 0 : state.routes.length - 1)].name : typeof params?.screen === 'string' ? params.screen : undefined;\n return routeName;\n}","map":{"version":3,"names":["CHILD_STATE","getFocusedRouteNameFromRoute","route","state","params","routeName","routes","index","type","length","name","screen","undefined"],"sources":["/Users/pmouli/Documents/GitHub.nosync/boots-strapper/mobile/node_modules/@react-navigation/core/src/getFocusedRouteNameFromRoute.tsx"],"sourcesContent":["import type { Route } from '@react-navigation/routers';\n\nimport { CHILD_STATE } from './useRouteCache';\n\nexport function getFocusedRouteNameFromRoute(\n route: Partial<Route<string>>\n): string | undefined {\n // @ts-expect-error: this isn't in type definitions coz we want this private\n const state = route[CHILD_STATE] ?? route.state;\n const params = route.params as { screen?: unknown } | undefined;\n\n const routeName = state\n ? // Get the currently active route name in the nested navigator\n state.routes[\n // If we have a partial state without index, for tab/drawer, first screen will be focused one, and last for stack\n // The type property will only exist for rehydrated state and not for state from deep link\n state.index ??\n (typeof state.type === 'string' && state.type !== 'stack'\n ? 0\n : state.routes.length - 1)\n ].name\n : // If state doesn't exist, we need to default to `screen` param if available\n typeof params?.screen === 'string'\n ? params.screen\n : undefined;\n\n return routeName;\n}\n"],"mappings":";;AAEA,SAASA,WAAW;AAEpB,OAAO,SAASC,4BAA4BA,CAC1CC,KAA6B,EACT;EAEpB,MAAMC,KAAK,GAAGD,KAAK,CAACF,WAAW,CAAC,IAAIE,KAAK,CAACC,KAAK;EAC/C,MAAMC,MAAM,GAAGF,KAAK,CAACE,MAA0C;EAE/D,MAAMC,SAAS,GAAGF,KAAK,GAEnBA,KAAK,CAACG,MAAM,CAGVH,KAAK,CAACI,KAAK,KACR,OAAOJ,KAAK,CAACK,IAAI,KAAK,QAAQ,IAAIL,KAAK,CAACK,IAAI,KAAK,OAAO,GACrD,CAAC,GACDL,KAAK,CAACG,MAAM,CAACG,MAAM,GAAG,CAAC,CAAC,CAC/B,CAACC,IAAI,GAEN,OAAON,MAAM,EAAEO,MAAM,KAAK,QAAQ,GAChCP,MAAM,CAACO,MAAM,GACbC,SAAS;EAEf,OAAOP,SAAS;AAClB","ignoreList":[]},"metadata":{"hasCjsExports":false},"sourceType":"module","externalDependencies":[]}