UNPKG

one

Version:

One is a React framework for web, iOS, and Android apps.

1 lines • 1.57 kB
{"version":3,"file":"isStateAwaitingNavigatorMount.js","names":[],"sources":["esm/router/isStateAwaitingNavigatorMount.js"],"sourcesContent":["import { getReactNavigationRouteName } from \"../getReactNavigationConfig\";\nfunction focusedRouteOf(state) {\n return typeof state.index === \"number\" ? state.routes[state.index] : state.routes[state.routes.length - 1];\n}\nfunction isStateAwaitingNavigatorMount(state, rootNode) {\n if (!rootNode) return false;\n let node = rootNode;\n let current = state;\n while (current?.routes?.length) {\n const route = focusedRouteOf(current);\n if (!route) return false;\n const child = node.children.find(\n (candidate) => getReactNavigationRouteName(candidate) === route.name\n );\n if (!child) return false;\n if (route.state) {\n node = child;\n current = route.state;\n continue;\n }\n return child.children.some((grandchild) => !grandchild.internal);\n }\n return false;\n}\nexport {\n isStateAwaitingNavigatorMount\n};\n//# sourceMappingURL=isStateAwaitingNavigatorMount.js.map\n"],"mappings":";;;AACA,SAAS,eAAe,OAAO;CAC7B,OAAO,OAAO,MAAM,UAAU,WAAW,MAAM,OAAO,MAAM,SAAS,MAAM,OAAO,MAAM,OAAO,SAAS;AAC1G;AACA,SAAS,8BAA8B,OAAO,UAAU;CACtD,IAAI,CAAC,UAAU,OAAO;CACtB,IAAI,OAAO;CACX,IAAI,UAAU;CACd,OAAO,SAAS,QAAQ,QAAQ;EAC9B,MAAM,QAAQ,eAAe,OAAO;EACpC,IAAI,CAAC,OAAO,OAAO;EACnB,MAAM,QAAQ,KAAK,SAAS,MACzB,cAAc,4BAA4B,SAAS,MAAM,MAAM,IAClE;EACA,IAAI,CAAC,OAAO,OAAO;EACnB,IAAI,MAAM,OAAO;GACf,OAAO;GACP,UAAU,MAAM;GAChB;EACF;EACA,OAAO,MAAM,SAAS,MAAM,eAAe,CAAC,WAAW,QAAQ;CACjE;CACA,OAAO;AACT"}