one 1.1.538 → 1.1.539

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (462) hide show
  1. package/dist/cjs/Root.native.js +83 -61
  2. package/dist/cjs/Root.native.js.map +1 -6
  3. package/dist/cjs/babel-plugins/one-router-metro.native.js +31 -20
  4. package/dist/cjs/babel-plugins/one-router-metro.native.js.map +1 -6
  5. package/dist/cjs/cli/build.native.js +340 -277
  6. package/dist/cjs/cli/build.native.js.map +1 -6
  7. package/dist/cjs/cli/buildPage.native.js +65 -36
  8. package/dist/cjs/cli/buildPage.native.js.map +1 -6
  9. package/dist/cjs/cli/checkNodeVersion.native.js +17 -14
  10. package/dist/cjs/cli/checkNodeVersion.native.js.map +1 -6
  11. package/dist/cjs/cli/dev.native.js +55 -37
  12. package/dist/cjs/cli/dev.native.js.map +1 -6
  13. package/dist/cjs/cli/label-process.native.js +20 -16
  14. package/dist/cjs/cli/label-process.native.js.map +1 -6
  15. package/dist/cjs/cli/main.native.js +37 -22
  16. package/dist/cjs/cli/main.native.js.map +1 -6
  17. package/dist/cjs/cli/patch.native.js +28 -19
  18. package/dist/cjs/cli/patch.native.js.map +1 -6
  19. package/dist/cjs/cli/prebuild.native.js +26 -18
  20. package/dist/cjs/cli/prebuild.native.js.map +1 -6
  21. package/dist/cjs/cli/runAndroid.native.js +26 -18
  22. package/dist/cjs/cli/runAndroid.native.js.map +1 -6
  23. package/dist/cjs/cli/runIos.native.js +26 -18
  24. package/dist/cjs/cli/runIos.native.js.map +1 -6
  25. package/dist/cjs/cli.native.js +281 -220
  26. package/dist/cjs/cli.native.js.map +1 -6
  27. package/dist/cjs/clientLoaderResolver.native.js +21 -19
  28. package/dist/cjs/clientLoaderResolver.native.js.map +1 -6
  29. package/dist/cjs/config.native.js +26 -21
  30. package/dist/cjs/config.native.js.map +1 -6
  31. package/dist/cjs/constants.native.js +36 -30
  32. package/dist/cjs/constants.native.js.map +1 -6
  33. package/dist/cjs/createApp.native.js +26 -21
  34. package/dist/cjs/createApp.native.js.map +1 -6
  35. package/dist/cjs/createHandleRequest.native.js +94 -85
  36. package/dist/cjs/createHandleRequest.native.js.map +1 -6
  37. package/dist/cjs/createMiddleware.native.js +17 -14
  38. package/dist/cjs/createMiddleware.native.js.map +1 -6
  39. package/dist/cjs/fallbackViews/Sitemap.native.js +21 -17
  40. package/dist/cjs/fallbackViews/Sitemap.native.js.map +1 -6
  41. package/dist/cjs/fallbackViews/Unmatched.native.js +27 -19
  42. package/dist/cjs/fallbackViews/Unmatched.native.js.map +1 -6
  43. package/dist/cjs/fork/NavigationContainer.native.js +93 -64
  44. package/dist/cjs/fork/NavigationContainer.native.js.map +1 -6
  45. package/dist/cjs/fork/__tests__/getPathFromState.test.cjs +9 -10
  46. package/dist/cjs/fork/__tests__/getPathFromState.test.js +3 -3
  47. package/dist/cjs/fork/__tests__/getPathFromState.test.js.map +1 -1
  48. package/dist/cjs/fork/__tests__/getPathFromState.test.native.js +1144 -1288
  49. package/dist/cjs/fork/__tests__/getPathFromState.test.native.js.map +1 -6
  50. package/dist/cjs/fork/__tests__/getStateFromPath.test.cjs +5 -7
  51. package/dist/cjs/fork/__tests__/getStateFromPath.test.js +5 -5
  52. package/dist/cjs/fork/__tests__/getStateFromPath.test.js.map +1 -1
  53. package/dist/cjs/fork/__tests__/getStateFromPath.test.native.js +1881 -2104
  54. package/dist/cjs/fork/__tests__/getStateFromPath.test.native.js.map +1 -6
  55. package/dist/cjs/fork/_shared.native.js +19 -19
  56. package/dist/cjs/fork/_shared.native.js.map +1 -6
  57. package/dist/cjs/fork/createMemoryHistory.native.js +131 -109
  58. package/dist/cjs/fork/createMemoryHistory.native.js.map +1 -6
  59. package/dist/cjs/fork/extractPathFromURL.native.js +43 -41
  60. package/dist/cjs/fork/extractPathFromURL.native.js.map +1 -6
  61. package/dist/cjs/fork/findFocusedRoute.native.js +20 -16
  62. package/dist/cjs/fork/findFocusedRoute.native.js.map +1 -6
  63. package/dist/cjs/fork/getPathFromState-mods.native.js +37 -25
  64. package/dist/cjs/fork/getPathFromState-mods.native.js.map +1 -6
  65. package/dist/cjs/fork/getPathFromState.native.js +112 -107
  66. package/dist/cjs/fork/getPathFromState.native.js.map +1 -6
  67. package/dist/cjs/fork/getPathFromState.test.native.js +63 -74
  68. package/dist/cjs/fork/getPathFromState.test.native.js.map +1 -6
  69. package/dist/cjs/fork/getStateFromPath-mods.native.js +126 -131
  70. package/dist/cjs/fork/getStateFromPath-mods.native.js.map +1 -6
  71. package/dist/cjs/fork/getStateFromPath.native.js +271 -240
  72. package/dist/cjs/fork/getStateFromPath.native.js.map +1 -6
  73. package/dist/cjs/fork/getStateFromPath.test.native.js +167 -306
  74. package/dist/cjs/fork/getStateFromPath.test.native.js.map +1 -6
  75. package/dist/cjs/fork/useBackButton.native.js +28 -23
  76. package/dist/cjs/fork/useBackButton.native.js.map +1 -6
  77. package/dist/cjs/fork/useDocumentTitle.native.js +17 -15
  78. package/dist/cjs/fork/useDocumentTitle.native.js.map +1 -6
  79. package/dist/cjs/fork/useLinking.native.js +111 -100
  80. package/dist/cjs/fork/useLinking.native.js.map +1 -6
  81. package/dist/cjs/fork/useThenable.native.js +41 -44
  82. package/dist/cjs/fork/useThenable.native.js.map +1 -6
  83. package/dist/cjs/fork/validatePathConfig.native.js +48 -49
  84. package/dist/cjs/fork/validatePathConfig.native.js.map +1 -6
  85. package/dist/cjs/getReactNavigationConfig.native.js +36 -39
  86. package/dist/cjs/getReactNavigationConfig.native.js.map +1 -6
  87. package/dist/cjs/getURL.native.js +25 -17
  88. package/dist/cjs/getURL.native.js.map +1 -6
  89. package/dist/cjs/head/Head.android.js +20 -16
  90. package/dist/cjs/head/Head.android.js.map +1 -6
  91. package/dist/cjs/head/Head.ios.js +162 -156
  92. package/dist/cjs/head/Head.ios.js.map +1 -6
  93. package/dist/cjs/head/Head.native.js +24 -18
  94. package/dist/cjs/head/Head.native.js.map +1 -6
  95. package/dist/cjs/head/HeadModule.native.js +21 -16
  96. package/dist/cjs/head/HeadModule.native.js.map +1 -6
  97. package/dist/cjs/head/index.native.js +13 -12
  98. package/dist/cjs/head/index.native.js.map +1 -6
  99. package/dist/cjs/head/types.native.js +9 -5
  100. package/dist/cjs/head/types.native.js.map +1 -6
  101. package/dist/cjs/head/url.js +2 -2
  102. package/dist/cjs/head/url.js.map +1 -1
  103. package/dist/cjs/head/url.native.js +23 -20
  104. package/dist/cjs/head/url.native.js.map +1 -6
  105. package/dist/cjs/hooks.native.js +62 -67
  106. package/dist/cjs/hooks.native.js.map +1 -6
  107. package/dist/cjs/href.native.js +18 -16
  108. package/dist/cjs/href.native.js.map +1 -6
  109. package/dist/cjs/import-mode/index.android.js +18 -10
  110. package/dist/cjs/import-mode/index.android.js.map +1 -6
  111. package/dist/cjs/import-mode/index.ios.js +18 -10
  112. package/dist/cjs/import-mode/index.ios.js.map +1 -6
  113. package/dist/cjs/import-mode/index.native.js +16 -9
  114. package/dist/cjs/import-mode/index.native.js.map +1 -6
  115. package/dist/cjs/index.native.js +57 -63
  116. package/dist/cjs/index.native.js.map +1 -6
  117. package/dist/cjs/interfaces/router.native.js +17 -14
  118. package/dist/cjs/interfaces/router.native.js.map +1 -6
  119. package/dist/cjs/layouts/Drawer.native.js +22 -15
  120. package/dist/cjs/layouts/Drawer.native.js.map +1 -6
  121. package/dist/cjs/layouts/Stack.native.js +22 -15
  122. package/dist/cjs/layouts/Stack.native.js.map +1 -6
  123. package/dist/cjs/layouts/Tabs.native.js +76 -63
  124. package/dist/cjs/layouts/Tabs.native.js.map +1 -6
  125. package/dist/cjs/layouts/withLayoutContext.native.js +67 -56
  126. package/dist/cjs/layouts/withLayoutContext.native.js.map +1 -6
  127. package/dist/cjs/link/Link.native.js +94 -89
  128. package/dist/cjs/link/Link.native.js.map +1 -6
  129. package/dist/cjs/link/Redirect.native.js +25 -20
  130. package/dist/cjs/link/Redirect.native.js.map +1 -6
  131. package/dist/cjs/link/href.native.js +42 -38
  132. package/dist/cjs/link/href.native.js.map +1 -6
  133. package/dist/cjs/link/linking.native.js +63 -61
  134. package/dist/cjs/link/linking.native.js.map +1 -6
  135. package/dist/cjs/link/path.native.js +34 -38
  136. package/dist/cjs/link/path.native.js.map +1 -6
  137. package/dist/cjs/link/useLinkTo.native.js +36 -30
  138. package/dist/cjs/link/useLinkTo.native.js.map +1 -6
  139. package/dist/cjs/link/useLoadedNavigation.native.js +40 -40
  140. package/dist/cjs/link/useLoadedNavigation.native.js.map +1 -6
  141. package/dist/cjs/metro-config/getViteMetroPluginOptions.native.js +115 -112
  142. package/dist/cjs/metro-config/getViteMetroPluginOptions.native.js.map +1 -6
  143. package/dist/cjs/polyfills-mobile.native.js +28 -15
  144. package/dist/cjs/polyfills-mobile.native.js.map +1 -6
  145. package/dist/cjs/polyfills-server.native.js +19 -13
  146. package/dist/cjs/polyfills-server.native.js.map +1 -6
  147. package/dist/cjs/render.native.js +16 -13
  148. package/dist/cjs/render.native.js.map +1 -6
  149. package/dist/cjs/router/FlagsContext.native.js +19 -15
  150. package/dist/cjs/router/FlagsContext.native.js.map +1 -6
  151. package/dist/cjs/router/Route.native.js +39 -28
  152. package/dist/cjs/router/Route.native.js.map +1 -6
  153. package/dist/cjs/router/RouteInfoContext.native.js +37 -21
  154. package/dist/cjs/router/RouteInfoContext.native.js.map +1 -6
  155. package/dist/cjs/router/RouterStore.native.js +9 -5
  156. package/dist/cjs/router/RouterStore.native.js.map +1 -6
  157. package/dist/cjs/router/createRoute.native.js +31 -26
  158. package/dist/cjs/router/createRoute.native.js.map +1 -6
  159. package/dist/cjs/router/filterRootHTML.native.js +40 -24
  160. package/dist/cjs/router/filterRootHTML.native.js.map +1 -6
  161. package/dist/cjs/router/getLinkingConfig.native.js +24 -21
  162. package/dist/cjs/router/getLinkingConfig.native.js.map +1 -6
  163. package/dist/cjs/router/getNormalizedStatePath.native.js +32 -28
  164. package/dist/cjs/router/getNormalizedStatePath.native.js.map +1 -6
  165. package/dist/cjs/router/getRoutes.native.js +261 -273
  166. package/dist/cjs/router/getRoutes.native.js.map +1 -6
  167. package/dist/cjs/router/glob-patterns.native.js +21 -24
  168. package/dist/cjs/router/glob-patterns.native.js.map +1 -6
  169. package/dist/cjs/router/imperative-api.native.js +39 -32
  170. package/dist/cjs/router/imperative-api.native.js.map +1 -6
  171. package/dist/cjs/router/lastAction.native.js +24 -20
  172. package/dist/cjs/router/lastAction.native.js.map +1 -6
  173. package/dist/cjs/router/matchers.native.js +18 -26
  174. package/dist/cjs/router/matchers.native.js.map +1 -6
  175. package/dist/cjs/router/matchers.test.native.js +19 -17
  176. package/dist/cjs/router/matchers.test.native.js.map +1 -6
  177. package/dist/cjs/router/router.native.js +156 -150
  178. package/dist/cjs/router/router.native.js.map +1 -6
  179. package/dist/cjs/router/serverLocationContext.native.js +19 -15
  180. package/dist/cjs/router/serverLocationContext.native.js.map +1 -6
  181. package/dist/cjs/router/sortRoutes.native.js +37 -44
  182. package/dist/cjs/router/sortRoutes.native.js.map +1 -6
  183. package/dist/cjs/router/useInitializeOneRouter.native.js +28 -20
  184. package/dist/cjs/router/useInitializeOneRouter.native.js.map +1 -6
  185. package/dist/cjs/router/useNavigation.native.js +42 -35
  186. package/dist/cjs/router/useNavigation.native.js.map +1 -6
  187. package/dist/cjs/router/useScreens.native.js +280 -248
  188. package/dist/cjs/router/useScreens.native.js.map +1 -6
  189. package/dist/cjs/router/useViteRoutes.native.js +36 -31
  190. package/dist/cjs/router/useViteRoutes.native.js.map +1 -6
  191. package/dist/cjs/router/utils/getNavigateAction.native.js +33 -23
  192. package/dist/cjs/router/utils/getNavigateAction.native.js.map +1 -6
  193. package/dist/cjs/router/utils/getNavigateAction.test.native.js +142 -197
  194. package/dist/cjs/router/utils/getNavigateAction.test.native.js.map +1 -6
  195. package/dist/cjs/serve-worker.native.js +25 -16
  196. package/dist/cjs/serve-worker.native.js.map +1 -6
  197. package/dist/cjs/serve.native.js +50 -25
  198. package/dist/cjs/serve.native.js.map +1 -6
  199. package/dist/cjs/server/ServerContextScript.native.js +31 -26
  200. package/dist/cjs/server/ServerContextScript.native.js.map +1 -6
  201. package/dist/cjs/server/createRoutesManifest.native.js +26 -23
  202. package/dist/cjs/server/createRoutesManifest.native.js.map +1 -6
  203. package/dist/cjs/server/getServerManifest.native.js +107 -87
  204. package/dist/cjs/server/getServerManifest.native.js.map +1 -6
  205. package/dist/cjs/server/oneServe.native.js +199 -132
  206. package/dist/cjs/server/oneServe.native.js.map +1 -6
  207. package/dist/cjs/server/setServerGlobals.native.js +17 -14
  208. package/dist/cjs/server/setServerGlobals.native.js.map +1 -6
  209. package/dist/cjs/server/setupBuildOptions.native.js +17 -14
  210. package/dist/cjs/server/setupBuildOptions.native.js.map +1 -6
  211. package/dist/cjs/server/setupServerGlobals.native.js +3 -2
  212. package/dist/cjs/server/setupServerGlobals.native.js.map +1 -6
  213. package/dist/cjs/server-render.native.js +39 -29
  214. package/dist/cjs/server-render.native.js.map +1 -6
  215. package/dist/cjs/setup.native.js.map +1 -6
  216. package/dist/cjs/testing-utils.native.js +39 -41
  217. package/dist/cjs/testing-utils.native.js.map +1 -6
  218. package/dist/cjs/typed-routes/generateRouteTypes.native.js +36 -22
  219. package/dist/cjs/typed-routes/generateRouteTypes.native.js.map +1 -6
  220. package/dist/cjs/typed-routes/getTypedRoutesDeclarationFile.native.js +53 -47
  221. package/dist/cjs/typed-routes/getTypedRoutesDeclarationFile.native.js.map +1 -6
  222. package/dist/cjs/types.native.js +9 -5
  223. package/dist/cjs/types.native.js.map +1 -6
  224. package/dist/cjs/useFocusEffect.native.js +39 -36
  225. package/dist/cjs/useFocusEffect.native.js.map +1 -6
  226. package/dist/cjs/useLoader.native.js +67 -52
  227. package/dist/cjs/useLoader.native.js.map +1 -6
  228. package/dist/cjs/useServerHeadInsertion.native.js +32 -25
  229. package/dist/cjs/useServerHeadInsertion.native.js.map +1 -6
  230. package/dist/cjs/utils/assertIsReady.native.js +18 -16
  231. package/dist/cjs/utils/assertIsReady.native.js.map +1 -6
  232. package/dist/cjs/utils/cleanUrl.native.js +26 -19
  233. package/dist/cjs/utils/cleanUrl.native.js.map +1 -6
  234. package/dist/cjs/utils/dynamicImport.native.js +18 -15
  235. package/dist/cjs/utils/dynamicImport.native.js.map +1 -6
  236. package/dist/cjs/utils/ensureExists.native.js +18 -16
  237. package/dist/cjs/utils/ensureExists.native.js.map +1 -6
  238. package/dist/cjs/utils/existsAsync.native.js +27 -23
  239. package/dist/cjs/utils/existsAsync.native.js.map +1 -6
  240. package/dist/cjs/utils/getPageExport.native.js +34 -30
  241. package/dist/cjs/utils/getPageExport.native.js.map +1 -6
  242. package/dist/cjs/utils/getPathnameFromFilePath.native.js +36 -27
  243. package/dist/cjs/utils/getPathnameFromFilePath.native.js.map +1 -6
  244. package/dist/cjs/utils/getRouterRootFromOneOptions.native.js +17 -14
  245. package/dist/cjs/utils/getRouterRootFromOneOptions.native.js.map +1 -6
  246. package/dist/cjs/utils/globDir.native.js +24 -18
  247. package/dist/cjs/utils/globDir.native.js.map +1 -6
  248. package/dist/cjs/utils/hashString.native.js +23 -17
  249. package/dist/cjs/utils/hashString.native.js.map +1 -6
  250. package/dist/cjs/utils/isResponse.native.js +21 -15
  251. package/dist/cjs/utils/isResponse.native.js.map +1 -6
  252. package/dist/cjs/utils/isRolldown.native.js +24 -19
  253. package/dist/cjs/utils/isRolldown.native.js.map +1 -6
  254. package/dist/cjs/utils/isStatus.native.js +17 -14
  255. package/dist/cjs/utils/isStatus.native.js.map +1 -6
  256. package/dist/cjs/utils/platform.native.js +17 -14
  257. package/dist/cjs/utils/platform.native.js.map +1 -6
  258. package/dist/cjs/utils/promiseWithResolvers.native.js +22 -17
  259. package/dist/cjs/utils/promiseWithResolvers.native.js.map +1 -6
  260. package/dist/cjs/utils/rand.native.js +18 -15
  261. package/dist/cjs/utils/rand.native.js.map +1 -6
  262. package/dist/cjs/utils/redirect.native.js +26 -21
  263. package/dist/cjs/utils/redirect.native.js.map +1 -6
  264. package/dist/cjs/utils/removeSearch.native.js +17 -14
  265. package/dist/cjs/utils/removeSearch.native.js.map +1 -6
  266. package/dist/cjs/utils/removeUndefined.native.js +18 -16
  267. package/dist/cjs/utils/removeUndefined.native.js.map +1 -6
  268. package/dist/cjs/utils/toAbsolute.native.js +21 -17
  269. package/dist/cjs/utils/toAbsolute.native.js.map +1 -6
  270. package/dist/cjs/utils/url.native.js +17 -16
  271. package/dist/cjs/utils/url.native.js.map +1 -6
  272. package/dist/cjs/utils/useConstant.native.js +26 -21
  273. package/dist/cjs/utils/useConstant.native.js.map +1 -6
  274. package/dist/cjs/utils/weakKey.native.js +25 -21
  275. package/dist/cjs/utils/weakKey.native.js.map +1 -6
  276. package/dist/cjs/utils/weakMemo.native.js +23 -18
  277. package/dist/cjs/utils/weakMemo.native.js.map +1 -6
  278. package/dist/cjs/utils/withStaticProperties.native.js +48 -35
  279. package/dist/cjs/utils/withStaticProperties.native.js.map +1 -6
  280. package/dist/cjs/vercel/build/buildVercelOutputDirectory.native.js +120 -95
  281. package/dist/cjs/vercel/build/buildVercelOutputDirectory.native.js.map +1 -6
  282. package/dist/cjs/vercel/build/config/vc-build-output-config-base.native.js +17 -14
  283. package/dist/cjs/vercel/build/config/vc-build-output-config-base.native.js.map +1 -6
  284. package/dist/cjs/vercel/build/config/vc-config-base.native.js +17 -14
  285. package/dist/cjs/vercel/build/config/vc-config-base.native.js.map +1 -6
  286. package/dist/cjs/vercel/build/config/vc-package-base.native.js +17 -14
  287. package/dist/cjs/vercel/build/config/vc-package-base.native.js.map +1 -6
  288. package/dist/cjs/vercel/build/generate/createApiServerlessFunction.native.js +60 -71
  289. package/dist/cjs/vercel/build/generate/createApiServerlessFunction.native.js.map +1 -6
  290. package/dist/cjs/vercel/build/generate/createSsrServerlessFunction.native.js +36 -24
  291. package/dist/cjs/vercel/build/generate/createSsrServerlessFunction.native.js.map +1 -6
  292. package/dist/cjs/vercel/build/getPathFromRoute.native.js +18 -15
  293. package/dist/cjs/vercel/build/getPathFromRoute.native.js.map +1 -6
  294. package/dist/cjs/views/EmptyRoute.native.js +19 -15
  295. package/dist/cjs/views/EmptyRoute.native.js.map +1 -6
  296. package/dist/cjs/views/ErrorBoundary.native.js +33 -19
  297. package/dist/cjs/views/ErrorBoundary.native.js.map +1 -6
  298. package/dist/cjs/views/LoadProgressBar.native.js +75 -67
  299. package/dist/cjs/views/LoadProgressBar.native.js.map +1 -6
  300. package/dist/cjs/views/Navigator.native.js +99 -64
  301. package/dist/cjs/views/Navigator.native.js.map +1 -6
  302. package/dist/cjs/views/OneStackRouter.native.js +27 -23
  303. package/dist/cjs/views/OneStackRouter.native.js.map +1 -6
  304. package/dist/cjs/views/PreloadLinks.native.js +16 -13
  305. package/dist/cjs/views/PreloadLinks.native.js.map +1 -6
  306. package/dist/cjs/views/RootErrorBoundary.native.js +54 -53
  307. package/dist/cjs/views/RootErrorBoundary.native.js.map +1 -6
  308. package/dist/cjs/views/Screen.native.js +28 -22
  309. package/dist/cjs/views/Screen.native.js.map +1 -6
  310. package/dist/cjs/views/ScrollBehavior.native.js +54 -43
  311. package/dist/cjs/views/ScrollBehavior.native.js.map +1 -6
  312. package/dist/cjs/views/Try.native.js +60 -54
  313. package/dist/cjs/views/Try.native.js.map +1 -6
  314. package/dist/cjs/vite/DevHead.native.js +19 -15
  315. package/dist/cjs/vite/DevHead.native.js.map +1 -6
  316. package/dist/cjs/vite/constants.native.js +20 -17
  317. package/dist/cjs/vite/constants.native.js.map +1 -6
  318. package/dist/cjs/vite/customNodeExternals.native.js +35 -25
  319. package/dist/cjs/vite/customNodeExternals.native.js.map +1 -6
  320. package/dist/cjs/vite/ensureTsConfig.native.js +21 -16
  321. package/dist/cjs/vite/ensureTsConfig.native.js.map +1 -6
  322. package/dist/cjs/vite/findDepsToOptimize.native.js +46 -43
  323. package/dist/cjs/vite/findDepsToOptimize.native.js.map +1 -6
  324. package/dist/cjs/vite/getManifest.native.js +23 -16
  325. package/dist/cjs/vite/getManifest.native.js.map +1 -6
  326. package/dist/cjs/vite/loadConfig.native.js +22 -22
  327. package/dist/cjs/vite/loadConfig.native.js.map +1 -6
  328. package/dist/cjs/vite/makePluginWebOnly.native.js +20 -19
  329. package/dist/cjs/vite/makePluginWebOnly.native.js.map +1 -6
  330. package/dist/cjs/vite/one-server-only.native.js +24 -33
  331. package/dist/cjs/vite/one-server-only.native.js.map +1 -6
  332. package/dist/cjs/vite/one.native.js +202 -181
  333. package/dist/cjs/vite/one.native.js.map +1 -6
  334. package/dist/cjs/vite/plugins/SSRCSSPlugin.native.js +75 -74
  335. package/dist/cjs/vite/plugins/SSRCSSPlugin.native.js.map +1 -6
  336. package/dist/cjs/vite/plugins/clientTreeShakePlugin.native.js +69 -56
  337. package/dist/cjs/vite/plugins/clientTreeShakePlugin.native.js.map +1 -6
  338. package/dist/cjs/vite/plugins/fileSystemRouterPlugin.native.js +154 -108
  339. package/dist/cjs/vite/plugins/fileSystemRouterPlugin.native.js.map +1 -6
  340. package/dist/cjs/vite/plugins/fixDependenciesPlugin.native.js +25 -16
  341. package/dist/cjs/vite/plugins/fixDependenciesPlugin.native.js.map +1 -6
  342. package/dist/cjs/vite/plugins/generateFileSystemRouteTypesPlugin.native.js +33 -24
  343. package/dist/cjs/vite/plugins/generateFileSystemRouteTypesPlugin.native.js.map +1 -6
  344. package/dist/cjs/vite/plugins/removeReactNativeWebAnimatedPlugin.native.js +26 -24
  345. package/dist/cjs/vite/plugins/removeReactNativeWebAnimatedPlugin.native.js.map +1 -6
  346. package/dist/cjs/vite/plugins/useDomPlugin.native.js +32 -26
  347. package/dist/cjs/vite/plugins/useDomPlugin.native.js.map +1 -6
  348. package/dist/cjs/vite/plugins/virtualEntryConstants.native.js +24 -20
  349. package/dist/cjs/vite/plugins/virtualEntryConstants.native.js.map +1 -6
  350. package/dist/cjs/vite/plugins/virtualEntryPlugin.native.js +38 -45
  351. package/dist/cjs/vite/plugins/virtualEntryPlugin.native.js.map +1 -6
  352. package/dist/cjs/vite/replaceLoader.native.js +26 -20
  353. package/dist/cjs/vite/replaceLoader.native.js.map +1 -6
  354. package/dist/cjs/vite/resolveResponse.native.js +59 -42
  355. package/dist/cjs/vite/resolveResponse.native.js.map +1 -6
  356. package/dist/cjs/vite/types.native.js +9 -5
  357. package/dist/cjs/vite/types.native.js.map +1 -6
  358. package/dist/cjs/vite.native.js +26 -22
  359. package/dist/cjs/vite.native.js.map +1 -6
  360. package/dist/cjs/zero/getQueryKey.native.js +18 -15
  361. package/dist/cjs/zero/getQueryKey.native.js.map +1 -6
  362. package/dist/cjs/zero/isZeroQuery.native.js +23 -15
  363. package/dist/cjs/zero/isZeroQuery.native.js.map +1 -6
  364. package/dist/cjs/zero/resolveQuery.native.js +23 -19
  365. package/dist/cjs/zero/resolveQuery.native.js.map +1 -6
  366. package/dist/cjs/zero/subscribeToQuery.native.js +18 -15
  367. package/dist/cjs/zero/subscribeToQuery.native.js.map +1 -6
  368. package/dist/cjs/zero/types.native.js +9 -5
  369. package/dist/cjs/zero/types.native.js.map +1 -6
  370. package/dist/cjs/zero/useQuery.js +2 -2
  371. package/dist/cjs/zero/useQuery.js.map +1 -1
  372. package/dist/cjs/zero/useQuery.native.js +30 -19
  373. package/dist/cjs/zero/useQuery.native.js.map +1 -6
  374. package/dist/cjs/zero/useQueryZero.native.js +35 -34
  375. package/dist/cjs/zero/useQueryZero.native.js.map +1 -6
  376. package/dist/cjs/zero.native.js +20 -17
  377. package/dist/cjs/zero.native.js.map +1 -6
  378. package/dist/esm/cli/build.native.js +2 -2
  379. package/dist/esm/cli/build.native.js.map +1 -1
  380. package/dist/esm/cli/buildPage.native.js +5 -2
  381. package/dist/esm/cli/buildPage.native.js.map +1 -1
  382. package/dist/esm/cli/label-process.native.js +1 -1
  383. package/dist/esm/cli/main.native.js +2 -2
  384. package/dist/esm/cli.native.js +3 -3
  385. package/dist/esm/createApp.native.js.map +1 -1
  386. package/dist/esm/fork/__tests__/getPathFromState.test.js +3 -3
  387. package/dist/esm/fork/__tests__/getPathFromState.test.js.map +1 -1
  388. package/dist/esm/fork/__tests__/getPathFromState.test.mjs +9 -10
  389. package/dist/esm/fork/__tests__/getPathFromState.test.mjs.map +1 -1
  390. package/dist/esm/fork/__tests__/getPathFromState.test.native.js.map +1 -1
  391. package/dist/esm/fork/__tests__/getStateFromPath.test.js +5 -5
  392. package/dist/esm/fork/__tests__/getStateFromPath.test.js.map +1 -1
  393. package/dist/esm/fork/__tests__/getStateFromPath.test.mjs +5 -7
  394. package/dist/esm/fork/__tests__/getStateFromPath.test.mjs.map +1 -1
  395. package/dist/esm/fork/__tests__/getStateFromPath.test.native.js.map +1 -1
  396. package/dist/esm/fork/getStateFromPath.native.js +6 -1
  397. package/dist/esm/fork/getStateFromPath.native.js.map +1 -1
  398. package/dist/esm/fork/useBackButton.native.js.map +1 -1
  399. package/dist/esm/fork/useDocumentTitle.native.js.map +1 -1
  400. package/dist/esm/fork/useLinking.native.js +6 -1
  401. package/dist/esm/fork/useLinking.native.js.map +1 -1
  402. package/dist/esm/fork/validatePathConfig.native.js +7 -2
  403. package/dist/esm/fork/validatePathConfig.native.js.map +1 -1
  404. package/dist/esm/getURL.native.js.map +1 -1
  405. package/dist/esm/head/Head.android.js.map +1 -1
  406. package/dist/esm/head/Head.ios.js +7 -2
  407. package/dist/esm/head/Head.ios.js.map +1 -1
  408. package/dist/esm/head/url.js +2 -2
  409. package/dist/esm/head/url.js.map +1 -1
  410. package/dist/esm/head/url.native.js.map +1 -1
  411. package/dist/esm/import-mode/index.android.js.map +1 -1
  412. package/dist/esm/import-mode/index.ios.js.map +1 -1
  413. package/dist/esm/import-mode/index.native.js.map +1 -1
  414. package/dist/esm/metro-config/getViteMetroPluginOptions.native.js +2 -2
  415. package/dist/esm/metro-config/getViteMetroPluginOptions.native.js.map +1 -1
  416. package/dist/esm/render.native.js.map +1 -1
  417. package/dist/esm/router/filterRootHTML.native.js +6 -1
  418. package/dist/esm/router/filterRootHTML.native.js.map +1 -1
  419. package/dist/esm/router/router.native.js +6 -1
  420. package/dist/esm/router/router.native.js.map +1 -1
  421. package/dist/esm/router/useScreens.native.js +7 -4
  422. package/dist/esm/router/useScreens.native.js.map +1 -1
  423. package/dist/esm/server/oneServe.native.js +1 -1
  424. package/dist/esm/testing-utils.native.js +1 -1
  425. package/dist/esm/typed-routes/generateRouteTypes.native.js +2 -2
  426. package/dist/esm/useLoader.native.js +5 -2
  427. package/dist/esm/useLoader.native.js.map +1 -1
  428. package/dist/esm/utils/existsAsync.native.js +1 -1
  429. package/dist/esm/utils/getPathnameFromFilePath.native.js +1 -1
  430. package/dist/esm/utils/isResponse.native.js +4 -1
  431. package/dist/esm/utils/isResponse.native.js.map +1 -1
  432. package/dist/esm/utils/toAbsolute.native.js +1 -1
  433. package/dist/esm/utils/withStaticProperties.native.js +6 -1
  434. package/dist/esm/utils/withStaticProperties.native.js.map +1 -1
  435. package/dist/esm/vercel/build/buildVercelOutputDirectory.native.js +1 -1
  436. package/dist/esm/vercel/build/generate/createApiServerlessFunction.native.js +1 -1
  437. package/dist/esm/vercel/build/generate/createSsrServerlessFunction.native.js +1 -1
  438. package/dist/esm/views/PreloadLinks.native.js.map +1 -1
  439. package/dist/esm/views/RootErrorBoundary.native.js +4 -1
  440. package/dist/esm/vite/customNodeExternals.native.js +2 -2
  441. package/dist/esm/vite/ensureTsConfig.native.js +1 -1
  442. package/dist/esm/vite/findDepsToOptimize.native.js +3 -3
  443. package/dist/esm/vite/one-server-only.native.js.map +1 -1
  444. package/dist/esm/vite/one.native.js +8 -3
  445. package/dist/esm/vite/one.native.js.map +1 -1
  446. package/dist/esm/vite/plugins/clientTreeShakePlugin.native.js +8 -5
  447. package/dist/esm/vite/plugins/clientTreeShakePlugin.native.js.map +1 -1
  448. package/dist/esm/vite/plugins/fileSystemRouterPlugin.native.js +8 -5
  449. package/dist/esm/vite/plugins/fileSystemRouterPlugin.native.js.map +1 -1
  450. package/dist/esm/vite/plugins/fixDependenciesPlugin.native.js +6 -1
  451. package/dist/esm/vite/plugins/fixDependenciesPlugin.native.js.map +1 -1
  452. package/dist/esm/vite/plugins/generateFileSystemRouteTypesPlugin.native.js +1 -1
  453. package/dist/esm/vite/plugins/generateFileSystemRouteTypesPlugin.native.js.map +1 -1
  454. package/dist/esm/vite/plugins/useDomPlugin.native.js +1 -1
  455. package/dist/esm/vite/resolveResponse.native.js +9 -1
  456. package/dist/esm/vite/resolveResponse.native.js.map +1 -1
  457. package/dist/esm/zero/isZeroQuery.native.js +6 -1
  458. package/dist/esm/zero/isZeroQuery.native.js.map +1 -1
  459. package/dist/esm/zero/useQuery.js +2 -2
  460. package/dist/esm/zero/useQuery.js.map +1 -1
  461. package/dist/esm/zero/useQuery.native.js.map +1 -1
  462. package/package.json +10 -10
@@ -1,129 +1,128 @@
1
1
  "use strict";
2
- var import_vitest = require("vitest"), import_immer = require("immer"), import_findFocusedRoute = require("../findFocusedRoute"), import_getPathFromState = require("../getPathFromState"), import_getStateFromPath = require("../getStateFromPath"), changePath = function(state, path) {
3
- return (0, import_immer.produce)(state, function(draftState) {
4
- var route = (0, import_findFocusedRoute.findFocusedRoute)(draftState);
5
- route.path = path;
6
- });
7
- };
8
- (0, import_vitest.test)("returns undefined for invalid path", function() {
2
+
3
+ var import_vitest = require("vitest"),
4
+ import_immer = require("immer"),
5
+ import_findFocusedRoute = require("../findFocusedRoute.native.js"),
6
+ import_getPathFromState = require("../getPathFromState.native.js"),
7
+ import_getStateFromPath = require("../getStateFromPath.native.js"),
8
+ changePath = function (state, path) {
9
+ return (0, import_immer.produce)(state, function (draftState) {
10
+ var route = (0, import_findFocusedRoute.findFocusedRoute)(draftState);
11
+ route.path = path;
12
+ });
13
+ };
14
+ (0, import_vitest.test)("returns undefined for invalid path", function () {
9
15
  (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)("//")).toBeUndefined();
10
16
  });
11
- import_vitest.test.skip("converts path string to initial state", function() {
12
- var path = "foo/bar/baz%20qux?author=jane%20%26%20co&valid=true", state = {
13
- routes: [
14
- {
17
+ import_vitest.test.skip("converts path string to initial state", function () {
18
+ var path = "foo/bar/baz%20qux?author=jane%20%26%20co&valid=true",
19
+ state = {
20
+ routes: [{
15
21
  name: "foo",
16
22
  state: {
17
- routes: [
18
- {
19
- name: "bar",
20
- state: {
21
- routes: [
22
- {
23
- name: "baz qux",
24
- params: {
25
- author: "jane & co",
26
- valid: "true"
27
- },
28
- path
29
- }
30
- ]
31
- }
23
+ routes: [{
24
+ name: "bar",
25
+ state: {
26
+ routes: [{
27
+ name: "baz qux",
28
+ params: {
29
+ author: "jane & co",
30
+ valid: "true"
31
+ },
32
+ path
33
+ }]
32
34
  }
33
- ]
35
+ }]
34
36
  }
35
- }
36
- ]
37
- };
37
+ }]
38
+ };
38
39
  (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)(path)).toEqual(state), (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)((0, import_getPathFromState.getPathFromState)(state))).toEqual(changePath(state, "/foo/bar/baz%20qux?author=jane%20%26%20co&valid=true"));
39
40
  });
40
- import_vitest.test.skip("decodes encoded params in path", function() {
41
- var path = "/foo/bar/bar_%23_foo", config = {
42
- screens: {
43
- Foo: {
44
- path: "foo",
45
- screens: {
46
- Bar: {
47
- path: "/bar/:id"
41
+ import_vitest.test.skip("decodes encoded params in path", function () {
42
+ var path = "/foo/bar/bar_%23_foo",
43
+ config = {
44
+ screens: {
45
+ Foo: {
46
+ path: "foo",
47
+ screens: {
48
+ Bar: {
49
+ path: "/bar/:id"
50
+ }
48
51
  }
49
52
  }
50
53
  }
51
- }
52
- }, state = {
53
- routes: [
54
- {
54
+ },
55
+ state = {
56
+ routes: [{
55
57
  name: "Foo",
56
58
  state: {
57
- routes: [
58
- {
59
- name: "Bar",
60
- params: {
61
- id: "bar_#_foo"
62
- },
63
- path
64
- }
65
- ]
59
+ routes: [{
60
+ name: "Bar",
61
+ params: {
62
+ id: "bar_#_foo"
63
+ },
64
+ path
65
+ }]
66
66
  }
67
- }
68
- ]
69
- };
67
+ }]
68
+ };
70
69
  (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)(path, config)).toEqual(state), (0, import_vitest.expect)((0, import_getPathFromState.getPathFromState)((0, import_getStateFromPath.getStateFromPath)(path, config), config)).toEqual(path);
71
70
  });
72
- import_vitest.test.skip("decodes encoded params in path that have encoded /", function() {
73
- var path = "/foo/bar/bar_%2F_foo", config = {
74
- screens: {
75
- Foo: {
76
- path: "foo",
77
- screens: {
78
- Bar: {
79
- path: "/bar/:id"
71
+ import_vitest.test.skip("decodes encoded params in path that have encoded /", function () {
72
+ var path = "/foo/bar/bar_%2F_foo",
73
+ config = {
74
+ screens: {
75
+ Foo: {
76
+ path: "foo",
77
+ screens: {
78
+ Bar: {
79
+ path: "/bar/:id"
80
+ }
80
81
  }
81
82
  }
82
83
  }
83
- }
84
- }, state = {
85
- routes: [
86
- {
84
+ },
85
+ state = {
86
+ routes: [{
87
87
  name: "Foo",
88
88
  state: {
89
- routes: [
90
- {
91
- name: "Bar",
92
- params: {
93
- id: "bar_/_foo"
94
- },
95
- path
96
- }
97
- ]
89
+ routes: [{
90
+ name: "Bar",
91
+ params: {
92
+ id: "bar_/_foo"
93
+ },
94
+ path
95
+ }]
98
96
  }
99
- }
100
- ]
101
- };
97
+ }]
98
+ };
102
99
  (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)(path, config)).toEqual(state), (0, import_vitest.expect)((0, import_getPathFromState.getPathFromState)((0, import_getStateFromPath.getStateFromPath)(path, config), config)).toEqual(path);
103
100
  });
104
- import_vitest.test.skip("converts path string to initial state with config", function() {
105
- var path = "/foo/bar/sweet/apple/baz/jane?count=10&answer=42&valid=true", config = {
106
- screens: {
107
- Foo: {
108
- path: "foo",
109
- screens: {
110
- Bar: {
111
- path: "bar/:type/:fruit",
112
- screens: {
113
- Baz: {
114
- path: "baz/:author",
115
- parse: {
116
- author: function(author) {
117
- return author.replace(/^\w/, function(c) {
118
- return c.toUpperCase();
119
- });
101
+ import_vitest.test.skip("converts path string to initial state with config", function () {
102
+ var path = "/foo/bar/sweet/apple/baz/jane?count=10&answer=42&valid=true",
103
+ config = {
104
+ screens: {
105
+ Foo: {
106
+ path: "foo",
107
+ screens: {
108
+ Bar: {
109
+ path: "bar/:type/:fruit",
110
+ screens: {
111
+ Baz: {
112
+ path: "baz/:author",
113
+ parse: {
114
+ author: function (author) {
115
+ return author.replace(/^\w/, function (c) {
116
+ return c.toUpperCase();
117
+ });
118
+ },
119
+ count: Number,
120
+ valid: Boolean
120
121
  },
121
- count: Number,
122
- valid: Boolean
123
- },
124
- stringify: {
125
- author: function(author) {
126
- return author.toLowerCase();
122
+ stringify: {
123
+ author: function (author) {
124
+ return author.toLowerCase();
125
+ }
127
126
  }
128
127
  }
129
128
  }
@@ -131,128 +130,113 @@ import_vitest.test.skip("converts path string to initial state with config", fun
131
130
  }
132
131
  }
133
132
  }
134
- }
135
- }, state = {
136
- routes: [
137
- {
133
+ },
134
+ state = {
135
+ routes: [{
138
136
  name: "Foo",
139
137
  state: {
140
- routes: [
141
- {
142
- name: "Bar",
143
- params: {
144
- fruit: "apple",
145
- type: "sweet"
146
- },
147
- state: {
148
- routes: [
149
- {
150
- name: "Baz",
151
- params: {
152
- author: "Jane",
153
- count: 10,
154
- answer: "42",
155
- valid: !0
156
- },
157
- path
158
- }
159
- ]
160
- }
138
+ routes: [{
139
+ name: "Bar",
140
+ params: {
141
+ fruit: "apple",
142
+ type: "sweet"
143
+ },
144
+ state: {
145
+ routes: [{
146
+ name: "Baz",
147
+ params: {
148
+ author: "Jane",
149
+ count: 10,
150
+ answer: "42",
151
+ valid: !0
152
+ },
153
+ path
154
+ }]
161
155
  }
162
- ]
156
+ }]
163
157
  }
164
- }
165
- ]
166
- };
158
+ }]
159
+ };
167
160
  (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)(path, config)).toEqual(state), (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)((0, import_getPathFromState.getPathFromState)(state, config), config)).toEqual(state);
168
161
  });
169
- (0, import_vitest.test)("handles leading slash when converting", function() {
162
+ (0, import_vitest.test)("handles leading slash when converting", function () {
170
163
  var path = "/foo/bar/?count=42";
171
164
  (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)(path)).toEqual({
172
- routes: [
173
- {
174
- name: "foo",
175
- state: {
176
- routes: [
177
- {
178
- name: "bar",
179
- params: {
180
- count: "42"
181
- },
182
- path
183
- }
184
- ]
185
- }
165
+ routes: [{
166
+ name: "foo",
167
+ state: {
168
+ routes: [{
169
+ name: "bar",
170
+ params: {
171
+ count: "42"
172
+ },
173
+ path
174
+ }]
186
175
  }
187
- ]
176
+ }]
188
177
  });
189
178
  });
190
- (0, import_vitest.test)("handles ending slash when converting", function() {
179
+ (0, import_vitest.test)("handles ending slash when converting", function () {
191
180
  var path = "foo/bar/?count=42";
192
181
  (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)(path)).toEqual({
193
- routes: [
194
- {
195
- name: "foo",
196
- state: {
197
- routes: [
198
- {
199
- name: "bar",
200
- params: {
201
- count: "42"
202
- },
203
- path
204
- }
205
- ]
206
- }
182
+ routes: [{
183
+ name: "foo",
184
+ state: {
185
+ routes: [{
186
+ name: "bar",
187
+ params: {
188
+ count: "42"
189
+ },
190
+ path
191
+ }]
207
192
  }
208
- ]
193
+ }]
209
194
  });
210
195
  });
211
- (0, import_vitest.test)("handles route without param", function() {
212
- var path = "foo/bar", state = {
213
- routes: [
214
- {
196
+ (0, import_vitest.test)("handles route without param", function () {
197
+ var path = "foo/bar",
198
+ state = {
199
+ routes: [{
215
200
  name: "foo",
216
201
  state: {
217
- routes: [
218
- {
219
- name: "bar",
220
- path
221
- }
222
- ]
202
+ routes: [{
203
+ name: "bar",
204
+ path
205
+ }]
223
206
  }
224
- }
225
- ]
226
- };
207
+ }]
208
+ };
227
209
  (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)(path)).toEqual(state), (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)((0, import_getPathFromState.getPathFromState)(state))).toEqual(changePath(state, "/foo/bar"));
228
210
  });
229
- import_vitest.test.skip("converts path string to initial state with config with nested screens", function() {
230
- var path = "/foe/bar/sweet/apple/baz/jane?count=10&answer=42&valid=true", config = {
231
- screens: {
232
- Foo: {
233
- path: "foo",
234
- screens: {
235
- Foe: {
236
- path: "foe",
237
- exact: !0,
238
- screens: {
239
- Bar: {
240
- path: "bar/:type/:fruit",
241
- screens: {
242
- Baz: {
243
- path: "baz/:author",
244
- parse: {
245
- author: function(author) {
246
- return author.replace(/^\w/, function(c) {
247
- return c.toUpperCase();
248
- });
211
+ import_vitest.test.skip("converts path string to initial state with config with nested screens", function () {
212
+ var path = "/foe/bar/sweet/apple/baz/jane?count=10&answer=42&valid=true",
213
+ config = {
214
+ screens: {
215
+ Foo: {
216
+ path: "foo",
217
+ screens: {
218
+ Foe: {
219
+ path: "foe",
220
+ exact: !0,
221
+ screens: {
222
+ Bar: {
223
+ path: "bar/:type/:fruit",
224
+ screens: {
225
+ Baz: {
226
+ path: "baz/:author",
227
+ parse: {
228
+ author: function (author) {
229
+ return author.replace(/^\w/, function (c) {
230
+ return c.toUpperCase();
231
+ });
232
+ },
233
+ count: Number,
234
+ valid: Boolean
249
235
  },
250
- count: Number,
251
- valid: Boolean
252
- },
253
- stringify: {
254
- author: function(author) {
255
- return author.toLowerCase();
236
+ stringify: {
237
+ author: function (author) {
238
+ return author.toLowerCase();
239
+ }
256
240
  }
257
241
  }
258
242
  }
@@ -262,140 +246,130 @@ import_vitest.test.skip("converts path string to initial state with config with
262
246
  }
263
247
  }
264
248
  }
265
- }
266
- }, state = {
267
- routes: [
268
- {
249
+ },
250
+ state = {
251
+ routes: [{
269
252
  name: "Foo",
270
253
  state: {
271
- routes: [
272
- {
273
- name: "Foe",
274
- state: {
275
- routes: [
276
- {
277
- name: "Bar",
254
+ routes: [{
255
+ name: "Foe",
256
+ state: {
257
+ routes: [{
258
+ name: "Bar",
259
+ params: {
260
+ fruit: "apple",
261
+ type: "sweet"
262
+ },
263
+ state: {
264
+ routes: [{
265
+ name: "Baz",
278
266
  params: {
279
- fruit: "apple",
280
- type: "sweet"
267
+ author: "Jane",
268
+ count: 10,
269
+ answer: "42",
270
+ valid: !0
281
271
  },
282
- state: {
283
- routes: [
284
- {
285
- name: "Baz",
286
- params: {
287
- author: "Jane",
288
- count: 10,
289
- answer: "42",
290
- valid: !0
291
- },
292
- path
293
- }
294
- ]
295
- }
296
- }
297
- ]
298
- }
272
+ path
273
+ }]
274
+ }
275
+ }]
299
276
  }
300
- ]
277
+ }]
301
278
  }
302
- }
303
- ]
304
- };
279
+ }]
280
+ };
305
281
  (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)(path, config)).toEqual(state), (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)((0, import_getPathFromState.getPathFromState)(state, config), config)).toEqual(state);
306
282
  });
307
- import_vitest.test.skip("converts path string to initial state with config with nested screens and unused parse functions", function() {
308
- var path = "/foe/baz/jane?count=10&answer=42&valid=true", config = {
309
- screens: {
310
- Foo: {
311
- path: "foo",
312
- screens: {
313
- Foe: {
314
- path: "foe",
315
- exact: !0,
316
- screens: {
317
- Baz: {
318
- path: "baz/:author",
319
- parse: {
320
- author: function(author) {
321
- return author.replace(/^\w/, function(c) {
322
- return c.toUpperCase();
323
- });
324
- },
325
- count: Number,
326
- valid: Boolean,
327
- id: Boolean
283
+ import_vitest.test.skip("converts path string to initial state with config with nested screens and unused parse functions", function () {
284
+ var path = "/foe/baz/jane?count=10&answer=42&valid=true",
285
+ config = {
286
+ screens: {
287
+ Foo: {
288
+ path: "foo",
289
+ screens: {
290
+ Foe: {
291
+ path: "foe",
292
+ exact: !0,
293
+ screens: {
294
+ Baz: {
295
+ path: "baz/:author",
296
+ parse: {
297
+ author: function (author) {
298
+ return author.replace(/^\w/, function (c) {
299
+ return c.toUpperCase();
300
+ });
301
+ },
302
+ count: Number,
303
+ valid: Boolean,
304
+ id: Boolean
305
+ }
328
306
  }
329
307
  }
330
308
  }
331
309
  }
332
310
  }
333
311
  }
334
- }
335
- }, state = {
336
- routes: [
337
- {
312
+ },
313
+ state = {
314
+ routes: [{
338
315
  name: "Foo",
339
316
  state: {
340
- routes: [
341
- {
342
- name: "Foe",
343
- state: {
344
- routes: [
345
- {
346
- name: "Baz",
347
- params: {
348
- author: "Jane",
349
- count: 10,
350
- answer: "42",
351
- valid: !0
352
- },
353
- path
354
- }
355
- ]
356
- }
317
+ routes: [{
318
+ name: "Foe",
319
+ state: {
320
+ routes: [{
321
+ name: "Baz",
322
+ params: {
323
+ author: "Jane",
324
+ count: 10,
325
+ answer: "42",
326
+ valid: !0
327
+ },
328
+ path
329
+ }]
357
330
  }
358
- ]
331
+ }]
359
332
  }
360
- }
361
- ]
362
- };
333
+ }]
334
+ };
363
335
  (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)(path, config)).toEqual(state), (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)((0, import_getPathFromState.getPathFromState)(state, config), config)).toEqual(changePath(state, "/foe/baz/Jane?count=10&answer=42&valid=true"));
364
336
  });
365
- import_vitest.test.skip("handles nested object with unused configs and with parse in it", function() {
366
- var path = "/bar/sweet/apple/foe/bis/jane?count=10&answer=42&valid=true", config = {
367
- screens: {
368
- Bar: {
369
- path: "bar/:type/:fruit",
370
- screens: {
371
- Foo: {
372
- screens: {
373
- Foe: {
374
- path: "foe",
375
- screens: {
376
- Baz: {
377
- screens: {
378
- Bos: {
379
- path: "bos",
380
- exact: !0
381
- },
382
- Bis: {
383
- path: "bis/:author",
384
- stringify: {
385
- author: function(author) {
386
- return author.replace(/^\w/, function(c) {
387
- return c.toLowerCase();
388
- });
389
- }
337
+ import_vitest.test.skip("handles nested object with unused configs and with parse in it", function () {
338
+ var path = "/bar/sweet/apple/foe/bis/jane?count=10&answer=42&valid=true",
339
+ config = {
340
+ screens: {
341
+ Bar: {
342
+ path: "bar/:type/:fruit",
343
+ screens: {
344
+ Foo: {
345
+ screens: {
346
+ Foe: {
347
+ path: "foe",
348
+ screens: {
349
+ Baz: {
350
+ screens: {
351
+ Bos: {
352
+ path: "bos",
353
+ exact: !0
390
354
  },
391
- parse: {
392
- author: function(author) {
393
- return author.replace(/^\w/, function(c) {
394
- return c.toUpperCase();
395
- });
355
+ Bis: {
356
+ path: "bis/:author",
357
+ stringify: {
358
+ author: function (author) {
359
+ return author.replace(/^\w/, function (c) {
360
+ return c.toLowerCase();
361
+ });
362
+ }
396
363
  },
397
- count: Number,
398
- valid: Boolean
364
+ parse: {
365
+ author: function (author) {
366
+ return author.replace(/^\w/, function (c) {
367
+ return c.toUpperCase();
368
+ });
369
+ },
370
+ count: Number,
371
+ valid: Boolean
372
+ }
399
373
  }
400
374
  }
401
375
  }
@@ -406,342 +380,310 @@ import_vitest.test.skip("handles nested object with unused configs and with pars
406
380
  }
407
381
  }
408
382
  }
409
- }
410
- }, state = {
411
- routes: [
412
- {
383
+ },
384
+ state = {
385
+ routes: [{
413
386
  name: "Bar",
414
387
  params: {
415
388
  fruit: "apple",
416
389
  type: "sweet"
417
390
  },
418
391
  state: {
419
- routes: [
420
- {
421
- name: "Foo",
422
- state: {
423
- routes: [
424
- {
425
- name: "Foe",
392
+ routes: [{
393
+ name: "Foo",
394
+ state: {
395
+ routes: [{
396
+ name: "Foe",
397
+ state: {
398
+ routes: [{
399
+ name: "Baz",
426
400
  state: {
427
- routes: [
428
- {
429
- name: "Baz",
430
- state: {
431
- routes: [
432
- {
433
- name: "Bis",
434
- params: {
435
- author: "Jane",
436
- count: 10,
437
- answer: "42",
438
- valid: !0
439
- },
440
- path
441
- }
442
- ]
443
- }
444
- }
445
- ]
401
+ routes: [{
402
+ name: "Bis",
403
+ params: {
404
+ author: "Jane",
405
+ count: 10,
406
+ answer: "42",
407
+ valid: !0
408
+ },
409
+ path
410
+ }]
446
411
  }
447
- }
448
- ]
449
- }
412
+ }]
413
+ }
414
+ }]
450
415
  }
451
- ]
416
+ }]
452
417
  }
453
- }
454
- ]
455
- };
418
+ }]
419
+ };
456
420
  (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)(path, config)).toEqual(state), (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)((0, import_getPathFromState.getPathFromState)(state, config), config)).toEqual(state);
457
421
  });
458
- (0, import_vitest.test)("handles parse in nested object for second route depth", function() {
459
- var path = "/baz", config = {
460
- screens: {
461
- Foo: {
462
- path: "foo",
463
- screens: {
464
- Foe: {
465
- path: "foe",
466
- exact: !0
467
- },
468
- Bar: {
469
- path: "bar",
470
- exact: !0,
471
- screens: {
472
- Baz: {
473
- path: "baz",
474
- exact: !0
422
+ (0, import_vitest.test)("handles parse in nested object for second route depth", function () {
423
+ var path = "/baz",
424
+ config = {
425
+ screens: {
426
+ Foo: {
427
+ path: "foo",
428
+ screens: {
429
+ Foe: {
430
+ path: "foe",
431
+ exact: !0
432
+ },
433
+ Bar: {
434
+ path: "bar",
435
+ exact: !0,
436
+ screens: {
437
+ Baz: {
438
+ path: "baz",
439
+ exact: !0
440
+ }
475
441
  }
476
442
  }
477
443
  }
478
444
  }
479
445
  }
480
- }
481
- }, state = {
482
- routes: [
483
- {
446
+ },
447
+ state = {
448
+ routes: [{
484
449
  name: "Foo",
485
450
  state: {
486
- routes: [
487
- {
488
- name: "Bar",
489
- state: {
490
- routes: [
491
- {
492
- name: "Baz",
493
- path
494
- }
495
- ]
496
- }
497
- }
498
- ]
499
- }
500
- }
501
- ]
502
- };
451
+ routes: [{
452
+ name: "Bar",
453
+ state: {
454
+ routes: [{
455
+ name: "Baz",
456
+ path
457
+ }]
458
+ }
459
+ }]
460
+ }
461
+ }]
462
+ };
503
463
  (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)(path, config)).toEqual(state), (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)((0, import_getPathFromState.getPathFromState)(state, config), config)).toEqual(state);
504
464
  });
505
- (0, import_vitest.test)("handles parse in nested object for second route depth and and path and parse in roots", function() {
506
- var path = "/baz", config = {
507
- screens: {
508
- Foo: {
509
- path: "foo/:id",
510
- parse: {
511
- id: Number
512
- },
513
- stringify: {
514
- id: function(id) {
515
- return `id=${id}`;
516
- }
517
- },
518
- screens: {
519
- Foe: "foe",
520
- Bar: {
521
- screens: {
522
- Baz: {
523
- path: "baz",
524
- exact: !0
465
+ (0, import_vitest.test)("handles parse in nested object for second route depth and and path and parse in roots", function () {
466
+ var path = "/baz",
467
+ config = {
468
+ screens: {
469
+ Foo: {
470
+ path: "foo/:id",
471
+ parse: {
472
+ id: Number
473
+ },
474
+ stringify: {
475
+ id: function (id) {
476
+ return `id=${id}`;
477
+ }
478
+ },
479
+ screens: {
480
+ Foe: "foe",
481
+ Bar: {
482
+ screens: {
483
+ Baz: {
484
+ path: "baz",
485
+ exact: !0
486
+ }
525
487
  }
526
488
  }
527
489
  }
528
490
  }
529
491
  }
530
- }
531
- }, state = {
532
- routes: [
533
- {
492
+ },
493
+ state = {
494
+ routes: [{
534
495
  name: "Foo",
535
496
  state: {
536
- routes: [
537
- {
538
- name: "Bar",
539
- state: {
540
- routes: [
541
- {
542
- name: "Baz",
543
- path
544
- }
545
- ]
546
- }
547
- }
548
- ]
549
- }
550
- }
551
- ]
552
- };
497
+ routes: [{
498
+ name: "Bar",
499
+ state: {
500
+ routes: [{
501
+ name: "Baz",
502
+ path
503
+ }]
504
+ }
505
+ }]
506
+ }
507
+ }]
508
+ };
553
509
  (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)(path, config)).toEqual(state), (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)((0, import_getPathFromState.getPathFromState)(state, config), config)).toEqual(state);
554
510
  });
555
- import_vitest.test.skip("handles path at top level", function() {
556
- var path = "/foo/fruits/apple", config = {
557
- path: "foo",
558
- screens: {
559
- Foo: {
560
- screens: {
561
- Fruits: "fruits/:fruit"
511
+ import_vitest.test.skip("handles path at top level", function () {
512
+ var path = "/foo/fruits/apple",
513
+ config = {
514
+ path: "foo",
515
+ screens: {
516
+ Foo: {
517
+ screens: {
518
+ Fruits: "fruits/:fruit"
519
+ }
562
520
  }
563
521
  }
564
- }
565
- }, state = {
566
- routes: [
567
- {
522
+ },
523
+ state = {
524
+ routes: [{
568
525
  name: "Foo",
569
526
  state: {
570
- routes: [
571
- {
572
- name: "Fruits",
573
- params: {
574
- fruit: "apple"
575
- },
576
- path
577
- }
578
- ]
527
+ routes: [{
528
+ name: "Fruits",
529
+ params: {
530
+ fruit: "apple"
531
+ },
532
+ path
533
+ }]
579
534
  }
580
- }
581
- ]
582
- };
535
+ }]
536
+ };
583
537
  (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)(path, config)).toEqual(state), (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)((0, import_getPathFromState.getPathFromState)(state, config), config)).toEqual(state);
584
538
  });
585
- (0, import_vitest.test)("handles initialRouteName at top level", function() {
586
- var path = "/baz", config = {
587
- initialRouteName: "Boo",
588
- screens: {
589
- Foo: {
590
- screens: {
591
- Foe: "foe",
592
- Bar: {
593
- screens: {
594
- Baz: "baz"
539
+ (0, import_vitest.test)("handles initialRouteName at top level", function () {
540
+ var path = "/baz",
541
+ config = {
542
+ initialRouteName: "Boo",
543
+ screens: {
544
+ Foo: {
545
+ screens: {
546
+ Foe: "foe",
547
+ Bar: {
548
+ screens: {
549
+ Baz: "baz"
550
+ }
595
551
  }
596
552
  }
597
553
  }
598
554
  }
599
- }
600
- }, state = {
601
- index: 1,
602
- routes: [
603
- {
555
+ },
556
+ state = {
557
+ index: 1,
558
+ routes: [{
604
559
  name: "Boo"
605
- },
606
- {
560
+ }, {
607
561
  name: "Foo",
608
562
  state: {
609
- routes: [
610
- {
611
- name: "Bar",
612
- state: {
613
- routes: [
614
- {
615
- name: "Baz",
616
- path
617
- }
618
- ]
619
- }
620
- }
621
- ]
622
- }
623
- }
624
- ]
625
- };
563
+ routes: [{
564
+ name: "Bar",
565
+ state: {
566
+ routes: [{
567
+ name: "Baz",
568
+ path
569
+ }]
570
+ }
571
+ }]
572
+ }
573
+ }]
574
+ };
626
575
  (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)(path, config)).toEqual(state), (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)((0, import_getPathFromState.getPathFromState)(state, config), config)).toEqual(state);
627
576
  });
628
- (0, import_vitest.test)("handles initialRouteName inside a screen", function() {
629
- var path = "/baz", config = {
630
- screens: {
631
- Foo: {
632
- initialRouteName: "Foe",
633
- screens: {
634
- Foe: "foe",
635
- Bar: {
636
- screens: {
637
- Baz: "baz"
577
+ (0, import_vitest.test)("handles initialRouteName inside a screen", function () {
578
+ var path = "/baz",
579
+ config = {
580
+ screens: {
581
+ Foo: {
582
+ initialRouteName: "Foe",
583
+ screens: {
584
+ Foe: "foe",
585
+ Bar: {
586
+ screens: {
587
+ Baz: "baz"
588
+ }
638
589
  }
639
590
  }
640
591
  }
641
592
  }
642
- }
643
- }, state = {
644
- routes: [
645
- {
593
+ },
594
+ state = {
595
+ routes: [{
646
596
  name: "Foo",
647
597
  state: {
648
598
  index: 1,
649
- routes: [
650
- {
651
- name: "Foe"
652
- },
653
- {
654
- name: "Bar",
655
- state: {
656
- routes: [
657
- {
658
- name: "Baz",
659
- path
660
- }
661
- ]
662
- }
663
- }
664
- ]
665
- }
666
- }
667
- ]
668
- };
599
+ routes: [{
600
+ name: "Foe"
601
+ }, {
602
+ name: "Bar",
603
+ state: {
604
+ routes: [{
605
+ name: "Baz",
606
+ path
607
+ }]
608
+ }
609
+ }]
610
+ }
611
+ }]
612
+ };
669
613
  (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)(path, config)).toEqual(state), (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)((0, import_getPathFromState.getPathFromState)(state, config), config)).toEqual(state);
670
614
  });
671
- (0, import_vitest.test)("handles initialRouteName included in path", function() {
672
- var path = "/baz", config = {
673
- screens: {
674
- Foo: {
675
- initialRouteName: "Foe",
676
- screens: {
677
- Foe: {
678
- screens: {
679
- Baz: "baz"
680
- }
681
- },
682
- Bar: "bar"
615
+ (0, import_vitest.test)("handles initialRouteName included in path", function () {
616
+ var path = "/baz",
617
+ config = {
618
+ screens: {
619
+ Foo: {
620
+ initialRouteName: "Foe",
621
+ screens: {
622
+ Foe: {
623
+ screens: {
624
+ Baz: "baz"
625
+ }
626
+ },
627
+ Bar: "bar"
628
+ }
683
629
  }
684
630
  }
685
- }
686
- }, state = {
687
- routes: [
688
- {
631
+ },
632
+ state = {
633
+ routes: [{
689
634
  name: "Foo",
690
635
  state: {
691
- routes: [
692
- {
693
- name: "Foe",
694
- state: {
695
- routes: [
696
- {
697
- name: "Baz",
698
- path
699
- }
700
- ]
701
- }
702
- }
703
- ]
704
- }
705
- }
706
- ]
707
- };
636
+ routes: [{
637
+ name: "Foe",
638
+ state: {
639
+ routes: [{
640
+ name: "Baz",
641
+ path
642
+ }]
643
+ }
644
+ }]
645
+ }
646
+ }]
647
+ };
708
648
  (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)(path, config)).toEqual(state), (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)((0, import_getPathFromState.getPathFromState)(state, config), config)).toEqual(state);
709
649
  });
710
- import_vitest.test.skip("handles two initialRouteNames", function() {
711
- var path = "/bar/sweet/apple/foe/bis/jane?answer=42&count=10&valid=true", config = {
712
- screens: {
713
- Bar: {
714
- path: "bar/:type/:fruit",
715
- screens: {
716
- Foo: {
717
- screens: {
718
- Foe: {
719
- path: "foe",
720
- screens: {
721
- Baz: {
722
- initialRouteName: "Bos",
723
- screens: {
724
- Bos: {
725
- path: "bos",
726
- exact: !0
727
- },
728
- Bis: {
729
- path: "bis/:author",
730
- stringify: {
731
- author: function(author) {
732
- return author.replace(/^\w/, function(c) {
733
- return c.toLowerCase();
734
- });
735
- }
650
+ import_vitest.test.skip("handles two initialRouteNames", function () {
651
+ var path = "/bar/sweet/apple/foe/bis/jane?answer=42&count=10&valid=true",
652
+ config = {
653
+ screens: {
654
+ Bar: {
655
+ path: "bar/:type/:fruit",
656
+ screens: {
657
+ Foo: {
658
+ screens: {
659
+ Foe: {
660
+ path: "foe",
661
+ screens: {
662
+ Baz: {
663
+ initialRouteName: "Bos",
664
+ screens: {
665
+ Bos: {
666
+ path: "bos",
667
+ exact: !0
736
668
  },
737
- parse: {
738
- author: function(author) {
739
- return author.replace(/^\w/, function(c) {
740
- return c.toUpperCase();
741
- });
669
+ Bis: {
670
+ path: "bis/:author",
671
+ stringify: {
672
+ author: function (author) {
673
+ return author.replace(/^\w/, function (c) {
674
+ return c.toLowerCase();
675
+ });
676
+ }
742
677
  },
743
- count: Number,
744
- valid: Boolean
678
+ parse: {
679
+ author: function (author) {
680
+ return author.replace(/^\w/, function (c) {
681
+ return c.toUpperCase();
682
+ });
683
+ },
684
+ count: Number,
685
+ valid: Boolean
686
+ }
745
687
  }
746
688
  }
747
689
  }
@@ -752,94 +694,85 @@ import_vitest.test.skip("handles two initialRouteNames", function() {
752
694
  }
753
695
  }
754
696
  }
755
- }
756
- }, state = {
757
- routes: [
758
- {
697
+ },
698
+ state = {
699
+ routes: [{
759
700
  name: "Bar",
760
701
  params: {
761
702
  fruit: "apple",
762
703
  type: "sweet"
763
704
  },
764
705
  state: {
765
- routes: [
766
- {
767
- name: "Foo",
768
- state: {
769
- routes: [
770
- {
771
- name: "Foe",
706
+ routes: [{
707
+ name: "Foo",
708
+ state: {
709
+ routes: [{
710
+ name: "Foe",
711
+ state: {
712
+ routes: [{
713
+ name: "Baz",
772
714
  state: {
773
- routes: [
774
- {
775
- name: "Baz",
776
- state: {
777
- index: 1,
778
- routes: [
779
- {
780
- name: "Bos"
781
- },
782
- {
783
- name: "Bis",
784
- params: {
785
- answer: "42",
786
- author: "Jane",
787
- count: 10,
788
- valid: !0
789
- },
790
- path
791
- }
792
- ]
793
- }
794
- }
795
- ]
715
+ index: 1,
716
+ routes: [{
717
+ name: "Bos"
718
+ }, {
719
+ name: "Bis",
720
+ params: {
721
+ answer: "42",
722
+ author: "Jane",
723
+ count: 10,
724
+ valid: !0
725
+ },
726
+ path
727
+ }]
796
728
  }
797
- }
798
- ]
799
- }
729
+ }]
730
+ }
731
+ }]
800
732
  }
801
- ]
733
+ }]
802
734
  }
803
- }
804
- ]
805
- };
735
+ }]
736
+ };
806
737
  (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)(path, config)).toEqual(state), (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)((0, import_getPathFromState.getPathFromState)(state, config), config)).toEqual(state);
807
738
  });
808
- import_vitest.test.skip("accepts initialRouteName without config for it", function() {
809
- var path = "/bar/sweet/apple/foe/bis/jane?answer=42&count=10&valid=true", config = {
810
- screens: {
811
- Bar: {
812
- path: "bar/:type/:fruit",
813
- screens: {
814
- Foo: {
815
- screens: {
816
- Foe: {
817
- path: "foe",
818
- screens: {
819
- Baz: {
820
- initialRouteName: "Bas",
821
- screens: {
822
- Bos: {
823
- path: "bos",
824
- exact: !0
825
- },
826
- Bis: {
827
- path: "bis/:author",
828
- stringify: {
829
- author: function(author) {
830
- return author.replace(/^\w/, function(c) {
831
- return c.toLowerCase();
832
- });
833
- }
739
+ import_vitest.test.skip("accepts initialRouteName without config for it", function () {
740
+ var path = "/bar/sweet/apple/foe/bis/jane?answer=42&count=10&valid=true",
741
+ config = {
742
+ screens: {
743
+ Bar: {
744
+ path: "bar/:type/:fruit",
745
+ screens: {
746
+ Foo: {
747
+ screens: {
748
+ Foe: {
749
+ path: "foe",
750
+ screens: {
751
+ Baz: {
752
+ initialRouteName: "Bas",
753
+ screens: {
754
+ Bos: {
755
+ path: "bos",
756
+ exact: !0
834
757
  },
835
- parse: {
836
- author: function(author) {
837
- return author.replace(/^\w/, function(c) {
838
- return c.toUpperCase();
839
- });
758
+ Bis: {
759
+ path: "bis/:author",
760
+ stringify: {
761
+ author: function (author) {
762
+ return author.replace(/^\w/, function (c) {
763
+ return c.toLowerCase();
764
+ });
765
+ }
840
766
  },
841
- count: Number,
842
- valid: Boolean
767
+ parse: {
768
+ author: function (author) {
769
+ return author.replace(/^\w/, function (c) {
770
+ return c.toUpperCase();
771
+ });
772
+ },
773
+ count: Number,
774
+ valid: Boolean
775
+ }
843
776
  }
844
777
  }
845
778
  }
@@ -850,1462 +783,1366 @@ import_vitest.test.skip("accepts initialRouteName without config for it", functi
850
783
  }
851
784
  }
852
785
  }
853
- }
854
- }, state = {
855
- routes: [
856
- {
786
+ },
787
+ state = {
788
+ routes: [{
857
789
  name: "Bar",
858
790
  params: {
859
791
  fruit: "apple",
860
792
  type: "sweet"
861
793
  },
862
794
  state: {
863
- routes: [
864
- {
865
- name: "Foo",
866
- state: {
867
- routes: [
868
- {
869
- name: "Foe",
795
+ routes: [{
796
+ name: "Foo",
797
+ state: {
798
+ routes: [{
799
+ name: "Foe",
800
+ state: {
801
+ routes: [{
802
+ name: "Baz",
870
803
  state: {
871
- routes: [
872
- {
873
- name: "Baz",
874
- state: {
875
- index: 1,
876
- routes: [
877
- {
878
- name: "Bas"
879
- },
880
- {
881
- name: "Bis",
882
- params: {
883
- answer: "42",
884
- author: "Jane",
885
- count: 10,
886
- valid: !0
887
- },
888
- path
889
- }
890
- ]
891
- }
892
- }
893
- ]
804
+ index: 1,
805
+ routes: [{
806
+ name: "Bas"
807
+ }, {
808
+ name: "Bis",
809
+ params: {
810
+ answer: "42",
811
+ author: "Jane",
812
+ count: 10,
813
+ valid: !0
814
+ },
815
+ path
816
+ }]
894
817
  }
895
- }
896
- ]
897
- }
818
+ }]
819
+ }
820
+ }]
898
821
  }
899
- ]
822
+ }]
900
823
  }
901
- }
902
- ]
903
- };
824
+ }]
825
+ };
904
826
  (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)(path, config)).toEqual(state), (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)((0, import_getPathFromState.getPathFromState)(state, config), config)).toEqual(state);
905
827
  });
906
- (0, import_vitest.test)("returns undefined if no matching screen is present (top level path)", function() {
907
- var path = "/foo/bar", config = {
908
- path: "qux",
909
- screens: {
910
- Foo: {
911
- screens: {
912
- Foe: "foo",
913
- Bar: {
914
- screens: {
915
- Baz: "bar"
828
+ (0, import_vitest.test)("returns undefined if no matching screen is present (top level path)", function () {
829
+ var path = "/foo/bar",
830
+ config = {
831
+ path: "qux",
832
+ screens: {
833
+ Foo: {
834
+ screens: {
835
+ Foe: "foo",
836
+ Bar: {
837
+ screens: {
838
+ Baz: "bar"
839
+ }
916
840
  }
917
841
  }
918
842
  }
919
843
  }
920
- }
921
- };
844
+ };
922
845
  (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)(path, config)).toBeUndefined();
923
846
  });
924
- (0, import_vitest.test)("returns undefined if no matching screen is present", function() {
925
- var path = "/baz", config = {
926
- screens: {
927
- Foo: {
928
- path: "foo",
929
- screens: {
930
- Foe: "foe",
931
- Bar: {
932
- screens: {
933
- Baz: "baz"
847
+ (0, import_vitest.test)("returns undefined if no matching screen is present", function () {
848
+ var path = "/baz",
849
+ config = {
850
+ screens: {
851
+ Foo: {
852
+ path: "foo",
853
+ screens: {
854
+ Foe: "foe",
855
+ Bar: {
856
+ screens: {
857
+ Baz: "baz"
858
+ }
934
859
  }
935
860
  }
936
861
  }
937
862
  }
938
- }
939
- };
863
+ };
940
864
  (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)(path, config)).toBeUndefined();
941
865
  });
942
- (0, import_vitest.test)("returns undefined if path is empty and no matching screen is present", function() {
943
- var path = "", config = {
944
- screens: {
945
- Foo: {
946
- screens: {
947
- Foe: "foe",
948
- Bar: {
949
- screens: {
950
- Baz: "baz"
866
+ (0, import_vitest.test)("returns undefined if path is empty and no matching screen is present", function () {
867
+ var path = "",
868
+ config = {
869
+ screens: {
870
+ Foo: {
871
+ screens: {
872
+ Foe: "foe",
873
+ Bar: {
874
+ screens: {
875
+ Baz: "baz"
876
+ }
951
877
  }
952
878
  }
953
879
  }
954
880
  }
955
- }
956
- };
881
+ };
957
882
  (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)(path, config)).toBeUndefined();
958
883
  });
959
- import_vitest.test.skip("returns matching screen if path is empty", function() {
960
- var path = "", config = {
961
- screens: {
962
- Foo: {
963
- screens: {
964
- Foe: "foe",
965
- Bar: {
966
- screens: {
967
- Qux: "",
968
- Baz: "baz"
884
+ import_vitest.test.skip("returns matching screen if path is empty", function () {
885
+ var path = "",
886
+ config = {
887
+ screens: {
888
+ Foo: {
889
+ screens: {
890
+ Foe: "foe",
891
+ Bar: {
892
+ screens: {
893
+ Qux: "",
894
+ Baz: "baz"
895
+ }
969
896
  }
970
897
  }
971
898
  }
972
899
  }
973
- }
974
- }, state = {
975
- routes: [
976
- {
900
+ },
901
+ state = {
902
+ routes: [{
977
903
  name: "Foo",
978
904
  state: {
979
- routes: [
980
- {
981
- name: "Bar",
982
- state: {
983
- routes: [
984
- {
985
- name: "Qux",
986
- path
987
- }
988
- ]
989
- }
990
- }
991
- ]
992
- }
993
- }
994
- ]
995
- };
905
+ routes: [{
906
+ name: "Bar",
907
+ state: {
908
+ routes: [{
909
+ name: "Qux",
910
+ path
911
+ }]
912
+ }
913
+ }]
914
+ }
915
+ }]
916
+ };
996
917
  (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)(path, config)).toEqual(state), (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)((0, import_getPathFromState.getPathFromState)(state, config), config)).toEqual(changePath(state, ""));
997
918
  });
998
- import_vitest.test.skip("returns matching screen if path is only slash", function() {
999
- var path = "/", config = {
1000
- screens: {
1001
- Foo: {
1002
- screens: {
1003
- Foe: "foe",
1004
- Bar: {
1005
- screens: {
1006
- Qux: "",
1007
- Baz: "baz"
919
+ import_vitest.test.skip("returns matching screen if path is only slash", function () {
920
+ var path = "/",
921
+ config = {
922
+ screens: {
923
+ Foo: {
924
+ screens: {
925
+ Foe: "foe",
926
+ Bar: {
927
+ screens: {
928
+ Qux: "",
929
+ Baz: "baz"
930
+ }
1008
931
  }
1009
932
  }
1010
933
  }
1011
934
  }
1012
- }
1013
- }, state = {
1014
- routes: [
1015
- {
935
+ },
936
+ state = {
937
+ routes: [{
1016
938
  name: "Foo",
1017
939
  state: {
1018
- routes: [
1019
- {
1020
- name: "Bar",
1021
- state: {
1022
- routes: [
1023
- {
1024
- name: "Qux",
1025
- path: ""
1026
- }
1027
- ]
1028
- }
1029
- }
1030
- ]
1031
- }
1032
- }
1033
- ]
1034
- };
940
+ routes: [{
941
+ name: "Bar",
942
+ state: {
943
+ routes: [{
944
+ name: "Qux",
945
+ path: ""
946
+ }]
947
+ }
948
+ }]
949
+ }
950
+ }]
951
+ };
1035
952
  (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)(path, config)).toEqual(state), (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)((0, import_getPathFromState.getPathFromState)(state, config), config)).toEqual(changePath(state, ""));
1036
953
  });
1037
- (0, import_vitest.test)("returns matching screen with params if path is empty", function() {
1038
- var path = "?foo=42", config = {
1039
- screens: {
1040
- Foo: {
1041
- screens: {
1042
- Foe: "foe",
1043
- Bar: {
1044
- screens: {
1045
- Qux: {
1046
- path: "",
1047
- parse: {
1048
- foo: Number
1049
- }
1050
- },
1051
- Baz: "baz"
954
+ (0, import_vitest.test)("returns matching screen with params if path is empty", function () {
955
+ var path = "?foo=42",
956
+ config = {
957
+ screens: {
958
+ Foo: {
959
+ screens: {
960
+ Foe: "foe",
961
+ Bar: {
962
+ screens: {
963
+ Qux: {
964
+ path: "",
965
+ parse: {
966
+ foo: Number
967
+ }
968
+ },
969
+ Baz: "baz"
970
+ }
1052
971
  }
1053
972
  }
1054
973
  }
1055
974
  }
1056
- }
1057
- }, state = {
1058
- routes: [
1059
- {
975
+ },
976
+ state = {
977
+ routes: [{
1060
978
  name: "Foo",
1061
979
  state: {
1062
- routes: [
1063
- {
1064
- name: "Bar",
1065
- state: {
1066
- routes: [
1067
- {
1068
- name: "Qux",
1069
- params: {
1070
- foo: 42
1071
- },
1072
- path
1073
- }
1074
- ]
1075
- }
980
+ routes: [{
981
+ name: "Bar",
982
+ state: {
983
+ routes: [{
984
+ name: "Qux",
985
+ params: {
986
+ foo: 42
987
+ },
988
+ path
989
+ }]
1076
990
  }
1077
- ]
991
+ }]
1078
992
  }
1079
- }
1080
- ]
1081
- };
993
+ }]
994
+ };
1082
995
  (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)(path, config)).toEqual(state), (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)((0, import_getPathFromState.getPathFromState)(state, config), config)).toEqual(changePath(state, "/?foo=42"));
1083
996
  });
1084
- (0, import_vitest.test)("doesn't match nested screen if path is empty", function() {
997
+ (0, import_vitest.test)("doesn't match nested screen if path is empty", function () {
1085
998
  var config = {
1086
- screens: {
1087
- Foo: {
1088
- screens: {
1089
- Foe: "foe",
1090
- Bar: {
1091
- path: "bar",
1092
- screens: {
1093
- Qux: {
1094
- path: "",
1095
- parse: {
1096
- foo: Number
999
+ screens: {
1000
+ Foo: {
1001
+ screens: {
1002
+ Foe: "foe",
1003
+ Bar: {
1004
+ path: "bar",
1005
+ screens: {
1006
+ Qux: {
1007
+ path: "",
1008
+ parse: {
1009
+ foo: Number
1010
+ }
1097
1011
  }
1098
1012
  }
1099
1013
  }
1100
1014
  }
1101
1015
  }
1102
1016
  }
1103
- }
1104
- }, path = "";
1017
+ },
1018
+ path = "";
1105
1019
  (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)(path, config)).toBeUndefined();
1106
1020
  });
1107
- import_vitest.test.skip("chooses more exhaustive pattern", function() {
1108
- var path = "/foo/5", config = {
1109
- screens: {
1110
- Foe: {
1111
- path: "/",
1112
- initialRouteName: "Foo",
1113
- screens: {
1114
- Foo: "foo",
1115
- Bis: {
1116
- path: "foo/:id",
1117
- parse: {
1118
- id: Number
1021
+ import_vitest.test.skip("chooses more exhaustive pattern", function () {
1022
+ var path = "/foo/5",
1023
+ config = {
1024
+ screens: {
1025
+ Foe: {
1026
+ path: "/",
1027
+ initialRouteName: "Foo",
1028
+ screens: {
1029
+ Foo: "foo",
1030
+ Bis: {
1031
+ path: "foo/:id",
1032
+ parse: {
1033
+ id: Number
1034
+ }
1119
1035
  }
1120
1036
  }
1121
1037
  }
1122
1038
  }
1123
- }
1124
- }, state = {
1125
- routes: [
1126
- {
1039
+ },
1040
+ state = {
1041
+ routes: [{
1127
1042
  name: "Foe",
1128
1043
  state: {
1129
1044
  index: 1,
1130
- routes: [
1131
- {
1132
- name: "Foo"
1045
+ routes: [{
1046
+ name: "Foo"
1047
+ }, {
1048
+ name: "Bis",
1049
+ params: {
1050
+ id: 5
1133
1051
  },
1134
- {
1135
- name: "Bis",
1136
- params: {
1137
- id: 5
1138
- },
1139
- path
1140
- }
1141
- ]
1052
+ path
1053
+ }]
1142
1054
  }
1143
- }
1144
- ]
1145
- };
1055
+ }]
1056
+ };
1146
1057
  (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)(path, config)).toEqual(state), (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)((0, import_getPathFromState.getPathFromState)(state, config), config)).toEqual(state);
1147
1058
  });
1148
- (0, import_vitest.test)("handles same paths beginnings", function() {
1149
- var path = "/foos", config = {
1150
- screens: {
1151
- Foe: {
1152
- path: "/",
1153
- initialRouteName: "Foo",
1154
- screens: {
1155
- Foo: "foo",
1156
- Bis: {
1157
- path: "foos"
1059
+ (0, import_vitest.test)("handles same paths beginnings", function () {
1060
+ var path = "/foos",
1061
+ config = {
1062
+ screens: {
1063
+ Foe: {
1064
+ path: "/",
1065
+ initialRouteName: "Foo",
1066
+ screens: {
1067
+ Foo: "foo",
1068
+ Bis: {
1069
+ path: "foos"
1070
+ }
1158
1071
  }
1159
1072
  }
1160
1073
  }
1161
- }
1162
- }, state = {
1163
- routes: [
1164
- {
1074
+ },
1075
+ state = {
1076
+ routes: [{
1165
1077
  name: "Foe",
1166
1078
  state: {
1167
1079
  index: 1,
1168
- routes: [
1169
- {
1170
- name: "Foo"
1171
- },
1172
- {
1173
- name: "Bis",
1174
- path
1175
- }
1176
- ]
1177
- }
1178
- }
1179
- ]
1180
- };
1080
+ routes: [{
1081
+ name: "Foo"
1082
+ }, {
1083
+ name: "Bis",
1084
+ path
1085
+ }]
1086
+ }
1087
+ }]
1088
+ };
1181
1089
  (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)(path, config)).toEqual(state), (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)((0, import_getPathFromState.getPathFromState)(state, config), config)).toEqual(state);
1182
- });
1183
- import_vitest.test.skip("handles same paths beginnings with params", function() {
1184
- var path = "/foos/5", config = {
1185
- screens: {
1186
- Foe: {
1187
- path: "/",
1188
- initialRouteName: "Foo",
1189
- screens: {
1190
- Foo: "foo",
1191
- Bis: {
1192
- path: "foos/:id",
1193
- parse: {
1194
- id: Number
1090
+ });
1091
+ import_vitest.test.skip("handles same paths beginnings with params", function () {
1092
+ var path = "/foos/5",
1093
+ config = {
1094
+ screens: {
1095
+ Foe: {
1096
+ path: "/",
1097
+ initialRouteName: "Foo",
1098
+ screens: {
1099
+ Foo: "foo",
1100
+ Bis: {
1101
+ path: "foos/:id",
1102
+ parse: {
1103
+ id: Number
1104
+ }
1195
1105
  }
1196
1106
  }
1197
1107
  }
1198
1108
  }
1199
- }
1200
- }, state = {
1201
- routes: [
1202
- {
1109
+ },
1110
+ state = {
1111
+ routes: [{
1203
1112
  name: "Foe",
1204
1113
  state: {
1205
1114
  index: 1,
1206
- routes: [
1207
- {
1208
- name: "Foo"
1115
+ routes: [{
1116
+ name: "Foo"
1117
+ }, {
1118
+ name: "Bis",
1119
+ params: {
1120
+ id: 5
1209
1121
  },
1210
- {
1211
- name: "Bis",
1212
- params: {
1213
- id: 5
1214
- },
1215
- path
1216
- }
1217
- ]
1122
+ path
1123
+ }]
1218
1124
  }
1219
- }
1220
- ]
1221
- };
1125
+ }]
1126
+ };
1222
1127
  (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)(path, config)).toEqual(state), (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)((0, import_getPathFromState.getPathFromState)(state, config), config)).toEqual(state);
1223
1128
  });
1224
- import_vitest.test.skip("handles not taking path with too many segments", function() {
1225
- var path = "/foos/5", config = {
1226
- screens: {
1227
- Foe: {
1228
- path: "/",
1229
- initialRouteName: "Foo",
1230
- screens: {
1231
- Foo: "foo",
1232
- Bis: {
1233
- path: "foos/:id",
1234
- parse: {
1235
- id: Number
1236
- }
1237
- },
1238
- Bas: {
1239
- path: "foos/:id/:nip",
1240
- parse: {
1241
- id: Number,
1242
- pwd: Number
1129
+ import_vitest.test.skip("handles not taking path with too many segments", function () {
1130
+ var path = "/foos/5",
1131
+ config = {
1132
+ screens: {
1133
+ Foe: {
1134
+ path: "/",
1135
+ initialRouteName: "Foo",
1136
+ screens: {
1137
+ Foo: "foo",
1138
+ Bis: {
1139
+ path: "foos/:id",
1140
+ parse: {
1141
+ id: Number
1142
+ }
1143
+ },
1144
+ Bas: {
1145
+ path: "foos/:id/:nip",
1146
+ parse: {
1147
+ id: Number,
1148
+ pwd: Number
1149
+ }
1243
1150
  }
1244
1151
  }
1245
1152
  }
1246
1153
  }
1247
- }
1248
- }, state = {
1249
- routes: [
1250
- {
1154
+ },
1155
+ state = {
1156
+ routes: [{
1251
1157
  name: "Foe",
1252
1158
  state: {
1253
1159
  index: 1,
1254
- routes: [
1255
- {
1256
- name: "Foo"
1160
+ routes: [{
1161
+ name: "Foo"
1162
+ }, {
1163
+ name: "Bis",
1164
+ params: {
1165
+ id: 5
1257
1166
  },
1258
- {
1259
- name: "Bis",
1260
- params: {
1261
- id: 5
1262
- },
1263
- path
1264
- }
1265
- ]
1167
+ path
1168
+ }]
1266
1169
  }
1267
- }
1268
- ]
1269
- };
1170
+ }]
1171
+ };
1270
1172
  (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)(path, config)).toEqual(state), (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)((0, import_getPathFromState.getPathFromState)(state, config), config)).toEqual(state);
1271
1173
  });
1272
- import_vitest.test.skip("handles differently ordered params v1", function() {
1273
- var path = "/foos/5/res/20", config = {
1274
- screens: {
1275
- Foe: {
1276
- path: "/",
1277
- initialRouteName: "Foo",
1278
- screens: {
1279
- Foo: "foo",
1280
- Bis: {
1281
- path: "foos/:id",
1282
- parse: {
1283
- id: Number
1284
- }
1285
- },
1286
- Bas: {
1287
- path: "foos/:id/res/:pwd",
1288
- parse: {
1289
- id: Number,
1290
- pwd: Number
1174
+ import_vitest.test.skip("handles differently ordered params v1", function () {
1175
+ var path = "/foos/5/res/20",
1176
+ config = {
1177
+ screens: {
1178
+ Foe: {
1179
+ path: "/",
1180
+ initialRouteName: "Foo",
1181
+ screens: {
1182
+ Foo: "foo",
1183
+ Bis: {
1184
+ path: "foos/:id",
1185
+ parse: {
1186
+ id: Number
1187
+ }
1188
+ },
1189
+ Bas: {
1190
+ path: "foos/:id/res/:pwd",
1191
+ parse: {
1192
+ id: Number,
1193
+ pwd: Number
1194
+ }
1291
1195
  }
1292
1196
  }
1293
1197
  }
1294
1198
  }
1295
- }
1296
- }, state = {
1297
- routes: [
1298
- {
1199
+ },
1200
+ state = {
1201
+ routes: [{
1299
1202
  name: "Foe",
1300
1203
  state: {
1301
1204
  index: 1,
1302
- routes: [
1303
- {
1304
- name: "Foo"
1205
+ routes: [{
1206
+ name: "Foo"
1207
+ }, {
1208
+ name: "Bas",
1209
+ params: {
1210
+ id: 5,
1211
+ pwd: 20
1305
1212
  },
1306
- {
1307
- name: "Bas",
1308
- params: {
1309
- id: 5,
1310
- pwd: 20
1311
- },
1312
- path
1313
- }
1314
- ]
1213
+ path
1214
+ }]
1315
1215
  }
1316
- }
1317
- ]
1318
- };
1216
+ }]
1217
+ };
1319
1218
  (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)(path, config)).toEqual(state), (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)((0, import_getPathFromState.getPathFromState)(state, config), config)).toEqual(state);
1320
1219
  });
1321
- import_vitest.test.skip("handles differently ordered params v2", function() {
1322
- var path = "/5/20/foos/res", config = {
1323
- screens: {
1324
- Foe: {
1325
- path: "/",
1326
- initialRouteName: "Foo",
1327
- screens: {
1328
- Foo: "foo",
1329
- Bis: {
1330
- path: "foos/:id",
1331
- parse: {
1332
- id: Number
1333
- }
1334
- },
1335
- Bas: {
1336
- path: ":id/:pwd/foos/res",
1337
- parse: {
1338
- id: Number,
1339
- pwd: Number
1220
+ import_vitest.test.skip("handles differently ordered params v2", function () {
1221
+ var path = "/5/20/foos/res",
1222
+ config = {
1223
+ screens: {
1224
+ Foe: {
1225
+ path: "/",
1226
+ initialRouteName: "Foo",
1227
+ screens: {
1228
+ Foo: "foo",
1229
+ Bis: {
1230
+ path: "foos/:id",
1231
+ parse: {
1232
+ id: Number
1233
+ }
1234
+ },
1235
+ Bas: {
1236
+ path: ":id/:pwd/foos/res",
1237
+ parse: {
1238
+ id: Number,
1239
+ pwd: Number
1240
+ }
1340
1241
  }
1341
1242
  }
1342
1243
  }
1343
1244
  }
1344
- }
1345
- }, state = {
1346
- routes: [
1347
- {
1245
+ },
1246
+ state = {
1247
+ routes: [{
1348
1248
  name: "Foe",
1349
1249
  state: {
1350
1250
  index: 1,
1351
- routes: [
1352
- {
1353
- name: "Foo"
1251
+ routes: [{
1252
+ name: "Foo"
1253
+ }, {
1254
+ name: "Bas",
1255
+ params: {
1256
+ id: 5,
1257
+ pwd: 20
1354
1258
  },
1355
- {
1356
- name: "Bas",
1357
- params: {
1358
- id: 5,
1359
- pwd: 20
1360
- },
1361
- path
1362
- }
1363
- ]
1259
+ path
1260
+ }]
1364
1261
  }
1365
- }
1366
- ]
1367
- };
1262
+ }]
1263
+ };
1368
1264
  (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)(path, config)).toEqual(state), (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)((0, import_getPathFromState.getPathFromState)(state, config), config)).toEqual(state);
1369
1265
  });
1370
- import_vitest.test.skip("handles differently ordered params v3", function() {
1371
- var path = "/foos/5/20/res", config = {
1372
- screens: {
1373
- Foe: {
1374
- path: "/",
1375
- initialRouteName: "Foo",
1376
- screens: {
1377
- Foo: "foo",
1378
- Bis: {
1379
- path: "foos/:id",
1380
- parse: {
1381
- id: Number
1382
- }
1383
- },
1384
- Bas: {
1385
- path: "foos/:id/:pwd/res",
1386
- parse: {
1387
- id: Number,
1388
- pwd: Number
1266
+ import_vitest.test.skip("handles differently ordered params v3", function () {
1267
+ var path = "/foos/5/20/res",
1268
+ config = {
1269
+ screens: {
1270
+ Foe: {
1271
+ path: "/",
1272
+ initialRouteName: "Foo",
1273
+ screens: {
1274
+ Foo: "foo",
1275
+ Bis: {
1276
+ path: "foos/:id",
1277
+ parse: {
1278
+ id: Number
1279
+ }
1280
+ },
1281
+ Bas: {
1282
+ path: "foos/:id/:pwd/res",
1283
+ parse: {
1284
+ id: Number,
1285
+ pwd: Number
1286
+ }
1389
1287
  }
1390
1288
  }
1391
1289
  }
1392
1290
  }
1393
- }
1394
- }, state = {
1395
- routes: [
1396
- {
1291
+ },
1292
+ state = {
1293
+ routes: [{
1397
1294
  name: "Foe",
1398
1295
  state: {
1399
1296
  index: 1,
1400
- routes: [
1401
- {
1402
- name: "Foo"
1297
+ routes: [{
1298
+ name: "Foo"
1299
+ }, {
1300
+ name: "Bas",
1301
+ params: {
1302
+ id: 5,
1303
+ pwd: 20
1403
1304
  },
1404
- {
1405
- name: "Bas",
1406
- params: {
1407
- id: 5,
1408
- pwd: 20
1409
- },
1410
- path
1411
- }
1412
- ]
1305
+ path
1306
+ }]
1413
1307
  }
1414
- }
1415
- ]
1416
- };
1308
+ }]
1309
+ };
1417
1310
  (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)(path, config)).toEqual(state), (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)((0, import_getPathFromState.getPathFromState)(state, config), config)).toEqual(state);
1418
1311
  });
1419
- import_vitest.test.skip("handles differently ordered params v4", function() {
1420
- var path = "5/foos/res/20", config = {
1421
- screens: {
1422
- Foe: {
1423
- path: "/",
1424
- initialRouteName: "Foo",
1425
- screens: {
1426
- Foo: "foo",
1427
- Bis: {
1428
- path: "foos/:id",
1429
- parse: {
1430
- id: Number
1431
- }
1432
- },
1433
- Bas: {
1434
- path: ":id/foos/res/:pwd",
1435
- parse: {
1436
- id: Number,
1437
- pwd: Number
1312
+ import_vitest.test.skip("handles differently ordered params v4", function () {
1313
+ var path = "5/foos/res/20",
1314
+ config = {
1315
+ screens: {
1316
+ Foe: {
1317
+ path: "/",
1318
+ initialRouteName: "Foo",
1319
+ screens: {
1320
+ Foo: "foo",
1321
+ Bis: {
1322
+ path: "foos/:id",
1323
+ parse: {
1324
+ id: Number
1325
+ }
1326
+ },
1327
+ Bas: {
1328
+ path: ":id/foos/res/:pwd",
1329
+ parse: {
1330
+ id: Number,
1331
+ pwd: Number
1332
+ }
1438
1333
  }
1439
1334
  }
1440
1335
  }
1441
1336
  }
1442
- }
1443
- }, state = {
1444
- routes: [
1445
- {
1337
+ },
1338
+ state = {
1339
+ routes: [{
1446
1340
  name: "Foe",
1447
1341
  state: {
1448
1342
  index: 1,
1449
- routes: [
1450
- {
1451
- name: "Foo"
1343
+ routes: [{
1344
+ name: "Foo"
1345
+ }, {
1346
+ name: "Bas",
1347
+ params: {
1348
+ id: 5,
1349
+ pwd: 20
1452
1350
  },
1453
- {
1454
- name: "Bas",
1455
- params: {
1456
- id: 5,
1457
- pwd: 20
1458
- },
1459
- path
1460
- }
1461
- ]
1351
+ path
1352
+ }]
1462
1353
  }
1463
- }
1464
- ]
1465
- };
1354
+ }]
1355
+ };
1466
1356
  (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)(path, config)).toEqual(state), (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)((0, import_getPathFromState.getPathFromState)(state, config), config)).toEqual(changePath(state, "/5/foos/res/20"));
1467
1357
  });
1468
- import_vitest.test.skip("handles simple optional params", function() {
1469
- var path = "/foos/5", config = {
1470
- screens: {
1471
- Foe: {
1472
- path: "/",
1473
- initialRouteName: "Foo",
1474
- screens: {
1475
- Foo: "foo",
1476
- Bis: {
1477
- path: "foo/:id",
1478
- parse: {
1479
- id: Number
1480
- }
1481
- },
1482
- Bas: {
1483
- path: "foos/:id/:nip?",
1484
- parse: {
1485
- id: Number,
1486
- nip: Number
1358
+ import_vitest.test.skip("handles simple optional params", function () {
1359
+ var path = "/foos/5",
1360
+ config = {
1361
+ screens: {
1362
+ Foe: {
1363
+ path: "/",
1364
+ initialRouteName: "Foo",
1365
+ screens: {
1366
+ Foo: "foo",
1367
+ Bis: {
1368
+ path: "foo/:id",
1369
+ parse: {
1370
+ id: Number
1371
+ }
1372
+ },
1373
+ Bas: {
1374
+ path: "foos/:id/:nip?",
1375
+ parse: {
1376
+ id: Number,
1377
+ nip: Number
1378
+ }
1487
1379
  }
1488
1380
  }
1489
1381
  }
1490
1382
  }
1491
- }
1492
- }, state = {
1493
- routes: [
1494
- {
1383
+ },
1384
+ state = {
1385
+ routes: [{
1495
1386
  name: "Foe",
1496
1387
  state: {
1497
1388
  index: 1,
1498
- routes: [
1499
- {
1500
- name: "Foo"
1389
+ routes: [{
1390
+ name: "Foo"
1391
+ }, {
1392
+ name: "Bas",
1393
+ params: {
1394
+ id: 5
1501
1395
  },
1502
- {
1503
- name: "Bas",
1504
- params: {
1505
- id: 5
1506
- },
1507
- path
1508
- }
1509
- ]
1396
+ path
1397
+ }]
1510
1398
  }
1511
- }
1512
- ]
1513
- };
1399
+ }]
1400
+ };
1514
1401
  (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)(path, config)).toEqual(state), (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)((0, import_getPathFromState.getPathFromState)(state, config), config)).toEqual(state);
1515
1402
  });
1516
- import_vitest.test.skip("handle 2 optional params at the end v1", function() {
1517
- var path = "/foos/5", config = {
1518
- screens: {
1519
- Foe: {
1520
- path: "/",
1521
- initialRouteName: "Foo",
1522
- screens: {
1523
- Foo: "foo",
1524
- Bis: {
1525
- path: "foo/:id",
1526
- parse: {
1527
- id: Number
1528
- }
1529
- },
1530
- Bas: {
1531
- path: "foos/:id/:nip?/:pwd?",
1532
- parse: {
1533
- id: Number,
1534
- nip: Number
1403
+ import_vitest.test.skip("handle 2 optional params at the end v1", function () {
1404
+ var path = "/foos/5",
1405
+ config = {
1406
+ screens: {
1407
+ Foe: {
1408
+ path: "/",
1409
+ initialRouteName: "Foo",
1410
+ screens: {
1411
+ Foo: "foo",
1412
+ Bis: {
1413
+ path: "foo/:id",
1414
+ parse: {
1415
+ id: Number
1416
+ }
1417
+ },
1418
+ Bas: {
1419
+ path: "foos/:id/:nip?/:pwd?",
1420
+ parse: {
1421
+ id: Number,
1422
+ nip: Number
1423
+ }
1535
1424
  }
1536
1425
  }
1537
1426
  }
1538
1427
  }
1539
- }
1540
- }, state = {
1541
- routes: [
1542
- {
1428
+ },
1429
+ state = {
1430
+ routes: [{
1543
1431
  name: "Foe",
1544
1432
  state: {
1545
1433
  index: 1,
1546
- routes: [
1547
- {
1548
- name: "Foo"
1434
+ routes: [{
1435
+ name: "Foo"
1436
+ }, {
1437
+ name: "Bas",
1438
+ params: {
1439
+ id: 5
1549
1440
  },
1550
- {
1551
- name: "Bas",
1552
- params: {
1553
- id: 5
1554
- },
1555
- path
1556
- }
1557
- ]
1441
+ path
1442
+ }]
1558
1443
  }
1559
- }
1560
- ]
1561
- };
1444
+ }]
1445
+ };
1562
1446
  (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)(path, config)).toEqual(state), (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)((0, import_getPathFromState.getPathFromState)(state, config), config)).toEqual(state);
1563
1447
  });
1564
- import_vitest.test.skip("handle 2 optional params at the end v2", function() {
1565
- var path = "/foos/5/10", config = {
1566
- screens: {
1567
- Foe: {
1568
- path: "/",
1569
- initialRouteName: "Foo",
1570
- screens: {
1571
- Foo: "foo",
1572
- Bis: {
1573
- path: "foo/:id",
1574
- parse: {
1575
- id: Number
1576
- }
1577
- },
1578
- Bas: {
1579
- path: "foos/:id/:nip?/:pwd?",
1580
- parse: {
1581
- id: Number,
1582
- nip: Number
1448
+ import_vitest.test.skip("handle 2 optional params at the end v2", function () {
1449
+ var path = "/foos/5/10",
1450
+ config = {
1451
+ screens: {
1452
+ Foe: {
1453
+ path: "/",
1454
+ initialRouteName: "Foo",
1455
+ screens: {
1456
+ Foo: "foo",
1457
+ Bis: {
1458
+ path: "foo/:id",
1459
+ parse: {
1460
+ id: Number
1461
+ }
1462
+ },
1463
+ Bas: {
1464
+ path: "foos/:id/:nip?/:pwd?",
1465
+ parse: {
1466
+ id: Number,
1467
+ nip: Number
1468
+ }
1583
1469
  }
1584
1470
  }
1585
1471
  }
1586
1472
  }
1587
- }
1588
- }, state = {
1589
- routes: [
1590
- {
1473
+ },
1474
+ state = {
1475
+ routes: [{
1591
1476
  name: "Foe",
1592
1477
  state: {
1593
1478
  index: 1,
1594
- routes: [
1595
- {
1596
- name: "Foo"
1479
+ routes: [{
1480
+ name: "Foo"
1481
+ }, {
1482
+ name: "Bas",
1483
+ params: {
1484
+ id: 5,
1485
+ nip: 10
1597
1486
  },
1598
- {
1599
- name: "Bas",
1600
- params: {
1601
- id: 5,
1602
- nip: 10
1603
- },
1604
- path
1605
- }
1606
- ]
1487
+ path
1488
+ }]
1607
1489
  }
1608
- }
1609
- ]
1610
- };
1490
+ }]
1491
+ };
1611
1492
  (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)(path, config)).toEqual(state), (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)((0, import_getPathFromState.getPathFromState)(state, config), config)).toEqual(state);
1612
1493
  });
1613
- import_vitest.test.skip("handle 2 optional params at the end v3", function() {
1614
- var path = "/foos/5/10/15", config = {
1615
- screens: {
1616
- Foe: {
1617
- path: "/",
1618
- initialRouteName: "Foo",
1619
- screens: {
1620
- Foo: "foo",
1621
- Bis: {
1622
- path: "foo/:id",
1623
- parse: {
1624
- id: Number
1625
- }
1626
- },
1627
- Bas: {
1628
- path: "foos/:id/:nip?/:pwd?",
1629
- parse: {
1630
- id: Number,
1631
- nip: Number,
1632
- pwd: Number
1494
+ import_vitest.test.skip("handle 2 optional params at the end v3", function () {
1495
+ var path = "/foos/5/10/15",
1496
+ config = {
1497
+ screens: {
1498
+ Foe: {
1499
+ path: "/",
1500
+ initialRouteName: "Foo",
1501
+ screens: {
1502
+ Foo: "foo",
1503
+ Bis: {
1504
+ path: "foo/:id",
1505
+ parse: {
1506
+ id: Number
1507
+ }
1508
+ },
1509
+ Bas: {
1510
+ path: "foos/:id/:nip?/:pwd?",
1511
+ parse: {
1512
+ id: Number,
1513
+ nip: Number,
1514
+ pwd: Number
1515
+ }
1633
1516
  }
1634
1517
  }
1635
1518
  }
1636
1519
  }
1637
- }
1638
- }, state = {
1639
- routes: [
1640
- {
1520
+ },
1521
+ state = {
1522
+ routes: [{
1641
1523
  name: "Foe",
1642
1524
  state: {
1643
1525
  index: 1,
1644
- routes: [
1645
- {
1646
- name: "Foo"
1526
+ routes: [{
1527
+ name: "Foo"
1528
+ }, {
1529
+ name: "Bas",
1530
+ params: {
1531
+ id: 5,
1532
+ nip: 10,
1533
+ pwd: 15
1647
1534
  },
1648
- {
1649
- name: "Bas",
1650
- params: {
1651
- id: 5,
1652
- nip: 10,
1653
- pwd: 15
1654
- },
1655
- path
1656
- }
1657
- ]
1535
+ path
1536
+ }]
1658
1537
  }
1659
- }
1660
- ]
1661
- };
1538
+ }]
1539
+ };
1662
1540
  (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)(path, config)).toEqual(state), (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)((0, import_getPathFromState.getPathFromState)(state, config), config)).toEqual(state);
1663
1541
  });
1664
- import_vitest.test.skip("handle optional params in the middle v1", function() {
1665
- var path = "/foos/5/10", config = {
1666
- screens: {
1667
- Foe: {
1668
- path: "/",
1669
- initialRouteName: "Foo",
1670
- screens: {
1671
- Foo: "foo",
1672
- Bis: {
1673
- path: "foo/:id",
1674
- parse: {
1675
- id: Number
1676
- }
1677
- },
1678
- Bas: {
1679
- path: "foos/:id/:nip?/:pwd",
1680
- parse: {
1681
- id: Number,
1682
- nip: Number,
1683
- pwd: Number
1542
+ import_vitest.test.skip("handle optional params in the middle v1", function () {
1543
+ var path = "/foos/5/10",
1544
+ config = {
1545
+ screens: {
1546
+ Foe: {
1547
+ path: "/",
1548
+ initialRouteName: "Foo",
1549
+ screens: {
1550
+ Foo: "foo",
1551
+ Bis: {
1552
+ path: "foo/:id",
1553
+ parse: {
1554
+ id: Number
1555
+ }
1556
+ },
1557
+ Bas: {
1558
+ path: "foos/:id/:nip?/:pwd",
1559
+ parse: {
1560
+ id: Number,
1561
+ nip: Number,
1562
+ pwd: Number
1563
+ }
1684
1564
  }
1685
1565
  }
1686
1566
  }
1687
1567
  }
1688
- }
1689
- }, state = {
1690
- routes: [
1691
- {
1568
+ },
1569
+ state = {
1570
+ routes: [{
1692
1571
  name: "Foe",
1693
1572
  state: {
1694
1573
  index: 1,
1695
- routes: [
1696
- {
1697
- name: "Foo"
1574
+ routes: [{
1575
+ name: "Foo"
1576
+ }, {
1577
+ name: "Bas",
1578
+ params: {
1579
+ id: 5,
1580
+ pwd: 10
1698
1581
  },
1699
- {
1700
- name: "Bas",
1701
- params: {
1702
- id: 5,
1703
- pwd: 10
1704
- },
1705
- path
1706
- }
1707
- ]
1582
+ path
1583
+ }]
1708
1584
  }
1709
- }
1710
- ]
1711
- };
1585
+ }]
1586
+ };
1712
1587
  (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)(path, config)).toEqual(state), (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)((0, import_getPathFromState.getPathFromState)(state, config), config)).toEqual(state);
1713
1588
  });
1714
- import_vitest.test.skip("handle optional params in the middle v2", function() {
1715
- var path = "/foos/5/10/15", config = {
1716
- screens: {
1717
- Foe: {
1718
- path: "/",
1719
- initialRouteName: "Foo",
1720
- screens: {
1721
- Foo: "foo",
1722
- Bis: {
1723
- path: "foo/:id",
1724
- parse: {
1725
- id: Number
1726
- }
1727
- },
1728
- Bas: {
1729
- path: "foos/:id/:nip?/:pwd",
1730
- parse: {
1731
- id: Number,
1732
- nip: Number,
1733
- pwd: Number
1589
+ import_vitest.test.skip("handle optional params in the middle v2", function () {
1590
+ var path = "/foos/5/10/15",
1591
+ config = {
1592
+ screens: {
1593
+ Foe: {
1594
+ path: "/",
1595
+ initialRouteName: "Foo",
1596
+ screens: {
1597
+ Foo: "foo",
1598
+ Bis: {
1599
+ path: "foo/:id",
1600
+ parse: {
1601
+ id: Number
1602
+ }
1603
+ },
1604
+ Bas: {
1605
+ path: "foos/:id/:nip?/:pwd",
1606
+ parse: {
1607
+ id: Number,
1608
+ nip: Number,
1609
+ pwd: Number
1610
+ }
1734
1611
  }
1735
1612
  }
1736
1613
  }
1737
1614
  }
1738
- }
1739
- }, state = {
1740
- routes: [
1741
- {
1615
+ },
1616
+ state = {
1617
+ routes: [{
1742
1618
  name: "Foe",
1743
1619
  state: {
1744
1620
  index: 1,
1745
- routes: [
1746
- {
1747
- name: "Foo"
1621
+ routes: [{
1622
+ name: "Foo"
1623
+ }, {
1624
+ name: "Bas",
1625
+ params: {
1626
+ id: 5,
1627
+ nip: 10,
1628
+ pwd: 15
1748
1629
  },
1749
- {
1750
- name: "Bas",
1751
- params: {
1752
- id: 5,
1753
- nip: 10,
1754
- pwd: 15
1755
- },
1756
- path
1757
- }
1758
- ]
1630
+ path
1631
+ }]
1759
1632
  }
1760
- }
1761
- ]
1762
- };
1633
+ }]
1634
+ };
1763
1635
  (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)(path, config)).toEqual(state), (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)((0, import_getPathFromState.getPathFromState)(state, config), config)).toEqual(state);
1764
1636
  });
1765
- import_vitest.test.skip("handle optional params in the middle v3", function() {
1766
- var path = "/foos/5/10/15", config = {
1767
- screens: {
1768
- Foe: {
1769
- path: "/",
1770
- initialRouteName: "Foo",
1771
- screens: {
1772
- Foo: "foo",
1773
- Bis: {
1774
- path: "foo/:id",
1775
- parse: {
1776
- id: Number
1777
- }
1778
- },
1779
- Bas: {
1780
- path: "foos/:id/:nip?/:pwd/:smh",
1781
- parse: {
1782
- id: Number,
1783
- nip: Number,
1784
- pwd: Number,
1785
- smh: Number
1637
+ import_vitest.test.skip("handle optional params in the middle v3", function () {
1638
+ var path = "/foos/5/10/15",
1639
+ config = {
1640
+ screens: {
1641
+ Foe: {
1642
+ path: "/",
1643
+ initialRouteName: "Foo",
1644
+ screens: {
1645
+ Foo: "foo",
1646
+ Bis: {
1647
+ path: "foo/:id",
1648
+ parse: {
1649
+ id: Number
1650
+ }
1651
+ },
1652
+ Bas: {
1653
+ path: "foos/:id/:nip?/:pwd/:smh",
1654
+ parse: {
1655
+ id: Number,
1656
+ nip: Number,
1657
+ pwd: Number,
1658
+ smh: Number
1659
+ }
1786
1660
  }
1787
1661
  }
1788
1662
  }
1789
1663
  }
1790
- }
1791
- }, state = {
1792
- routes: [
1793
- {
1664
+ },
1665
+ state = {
1666
+ routes: [{
1794
1667
  name: "Foe",
1795
1668
  state: {
1796
1669
  index: 1,
1797
- routes: [
1798
- {
1799
- name: "Foo"
1670
+ routes: [{
1671
+ name: "Foo"
1672
+ }, {
1673
+ name: "Bas",
1674
+ params: {
1675
+ id: 5,
1676
+ pwd: 10,
1677
+ smh: 15
1800
1678
  },
1801
- {
1802
- name: "Bas",
1803
- params: {
1804
- id: 5,
1805
- pwd: 10,
1806
- smh: 15
1807
- },
1808
- path
1809
- }
1810
- ]
1679
+ path
1680
+ }]
1811
1681
  }
1812
- }
1813
- ]
1814
- };
1682
+ }]
1683
+ };
1815
1684
  (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)(path, config)).toEqual(state), (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)((0, import_getPathFromState.getPathFromState)(state, config), config)).toEqual(state);
1816
1685
  });
1817
- import_vitest.test.skip("handle optional params in the middle v4", function() {
1818
- var path = "/foos/5/10", config = {
1819
- screens: {
1820
- Foe: {
1821
- path: "/",
1822
- initialRouteName: "Foo",
1823
- screens: {
1824
- Foo: "foo",
1825
- Bis: {
1826
- path: "foo/:id",
1827
- parse: {
1828
- id: Number
1829
- }
1830
- },
1831
- Bas: {
1832
- path: "foos/:nip?/:pwd/:smh?/:id",
1833
- parse: {
1834
- id: Number,
1835
- nip: Number,
1836
- pwd: Number,
1837
- smh: Number
1686
+ import_vitest.test.skip("handle optional params in the middle v4", function () {
1687
+ var path = "/foos/5/10",
1688
+ config = {
1689
+ screens: {
1690
+ Foe: {
1691
+ path: "/",
1692
+ initialRouteName: "Foo",
1693
+ screens: {
1694
+ Foo: "foo",
1695
+ Bis: {
1696
+ path: "foo/:id",
1697
+ parse: {
1698
+ id: Number
1699
+ }
1700
+ },
1701
+ Bas: {
1702
+ path: "foos/:nip?/:pwd/:smh?/:id",
1703
+ parse: {
1704
+ id: Number,
1705
+ nip: Number,
1706
+ pwd: Number,
1707
+ smh: Number
1708
+ }
1838
1709
  }
1839
1710
  }
1840
1711
  }
1841
1712
  }
1842
- }
1843
- }, state = {
1844
- routes: [
1845
- {
1713
+ },
1714
+ state = {
1715
+ routes: [{
1846
1716
  name: "Foe",
1847
1717
  state: {
1848
1718
  index: 1,
1849
- routes: [
1850
- {
1851
- name: "Foo"
1719
+ routes: [{
1720
+ name: "Foo"
1721
+ }, {
1722
+ name: "Bas",
1723
+ params: {
1724
+ pwd: 5,
1725
+ id: 10
1852
1726
  },
1853
- {
1854
- name: "Bas",
1855
- params: {
1856
- pwd: 5,
1857
- id: 10
1858
- },
1859
- path
1860
- }
1861
- ]
1727
+ path
1728
+ }]
1862
1729
  }
1863
- }
1864
- ]
1865
- };
1730
+ }]
1731
+ };
1866
1732
  (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)(path, config)).toEqual(state), (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)((0, import_getPathFromState.getPathFromState)(state, config), config)).toEqual(state);
1867
1733
  });
1868
- import_vitest.test.skip("handle optional params in the middle v5", function() {
1869
- var path = "/foos/5/10/15", config = {
1870
- screens: {
1871
- Foe: {
1872
- path: "/",
1873
- initialRouteName: "Foo",
1874
- screens: {
1875
- Foo: "foo",
1876
- Bis: {
1877
- path: "foo/:id",
1878
- parse: {
1879
- id: Number
1880
- }
1881
- },
1882
- Bas: {
1883
- path: "foos/:nip?/:pwd/:smh?/:id",
1884
- parse: {
1885
- id: Number,
1886
- nip: Number,
1887
- pwd: Number,
1888
- smh: Number
1734
+ import_vitest.test.skip("handle optional params in the middle v5", function () {
1735
+ var path = "/foos/5/10/15",
1736
+ config = {
1737
+ screens: {
1738
+ Foe: {
1739
+ path: "/",
1740
+ initialRouteName: "Foo",
1741
+ screens: {
1742
+ Foo: "foo",
1743
+ Bis: {
1744
+ path: "foo/:id",
1745
+ parse: {
1746
+ id: Number
1747
+ }
1748
+ },
1749
+ Bas: {
1750
+ path: "foos/:nip?/:pwd/:smh?/:id",
1751
+ parse: {
1752
+ id: Number,
1753
+ nip: Number,
1754
+ pwd: Number,
1755
+ smh: Number
1756
+ }
1889
1757
  }
1890
1758
  }
1891
1759
  }
1892
1760
  }
1893
- }
1894
- }, state = {
1895
- routes: [
1896
- {
1761
+ },
1762
+ state = {
1763
+ routes: [{
1897
1764
  name: "Foe",
1898
1765
  state: {
1899
1766
  index: 1,
1900
- routes: [
1901
- {
1902
- name: "Foo"
1767
+ routes: [{
1768
+ name: "Foo"
1769
+ }, {
1770
+ name: "Bas",
1771
+ params: {
1772
+ nip: 5,
1773
+ pwd: 10,
1774
+ id: 15
1903
1775
  },
1904
- {
1905
- name: "Bas",
1906
- params: {
1907
- nip: 5,
1908
- pwd: 10,
1909
- id: 15
1910
- },
1911
- path
1912
- }
1913
- ]
1776
+ path
1777
+ }]
1914
1778
  }
1915
- }
1916
- ]
1917
- };
1779
+ }]
1780
+ };
1918
1781
  (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)(path, config)).toEqual(state), (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)((0, import_getPathFromState.getPathFromState)(state, config), config)).toEqual(state);
1919
1782
  });
1920
- import_vitest.test.skip("handle optional params in the beginning v1", function() {
1921
- var path = "5/10/foos/15", config = {
1922
- screens: {
1923
- Foe: {
1924
- path: "/",
1925
- initialRouteName: "Foo",
1926
- screens: {
1927
- Foo: "foo",
1928
- Bis: {
1929
- path: "foo/:id",
1930
- parse: {
1931
- id: Number
1932
- }
1933
- },
1934
- Bas: {
1935
- path: ":nip?/:pwd/foos/:smh?/:id",
1936
- parse: {
1937
- id: Number,
1938
- nip: Number,
1939
- pwd: Number,
1940
- smh: Number
1783
+ import_vitest.test.skip("handle optional params in the beginning v1", function () {
1784
+ var path = "5/10/foos/15",
1785
+ config = {
1786
+ screens: {
1787
+ Foe: {
1788
+ path: "/",
1789
+ initialRouteName: "Foo",
1790
+ screens: {
1791
+ Foo: "foo",
1792
+ Bis: {
1793
+ path: "foo/:id",
1794
+ parse: {
1795
+ id: Number
1796
+ }
1797
+ },
1798
+ Bas: {
1799
+ path: ":nip?/:pwd/foos/:smh?/:id",
1800
+ parse: {
1801
+ id: Number,
1802
+ nip: Number,
1803
+ pwd: Number,
1804
+ smh: Number
1805
+ }
1941
1806
  }
1942
1807
  }
1943
1808
  }
1944
1809
  }
1945
- }
1946
- }, state = {
1947
- routes: [
1948
- {
1810
+ },
1811
+ state = {
1812
+ routes: [{
1949
1813
  name: "Foe",
1950
1814
  state: {
1951
1815
  index: 1,
1952
- routes: [
1953
- {
1954
- name: "Foo"
1816
+ routes: [{
1817
+ name: "Foo"
1818
+ }, {
1819
+ name: "Bas",
1820
+ params: {
1821
+ nip: 5,
1822
+ pwd: 10,
1823
+ id: 15
1955
1824
  },
1956
- {
1957
- name: "Bas",
1958
- params: {
1959
- nip: 5,
1960
- pwd: 10,
1961
- id: 15
1962
- },
1963
- path
1964
- }
1965
- ]
1825
+ path
1826
+ }]
1966
1827
  }
1967
- }
1968
- ]
1969
- };
1828
+ }]
1829
+ };
1970
1830
  (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)(path, config)).toEqual(state), (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)((0, import_getPathFromState.getPathFromState)(state, config), config)).toEqual(changePath(state, "/5/10/foos/15"));
1971
1831
  });
1972
- import_vitest.test.skip("handle optional params in the beginning v2", function() {
1973
- var path = "5/10/foos/15", config = {
1974
- screens: {
1975
- Foe: {
1976
- path: "/",
1977
- initialRouteName: "Foo",
1978
- screens: {
1979
- Foo: "foo",
1980
- Bis: {
1981
- path: "foo/:id",
1982
- parse: {
1983
- id: Number
1984
- }
1985
- },
1986
- Bas: {
1987
- path: ":nip?/:smh?/:pwd/foos/:id",
1988
- parse: {
1989
- id: Number,
1990
- nip: Number,
1991
- pwd: Number,
1992
- smh: Number
1832
+ import_vitest.test.skip("handle optional params in the beginning v2", function () {
1833
+ var path = "5/10/foos/15",
1834
+ config = {
1835
+ screens: {
1836
+ Foe: {
1837
+ path: "/",
1838
+ initialRouteName: "Foo",
1839
+ screens: {
1840
+ Foo: "foo",
1841
+ Bis: {
1842
+ path: "foo/:id",
1843
+ parse: {
1844
+ id: Number
1845
+ }
1846
+ },
1847
+ Bas: {
1848
+ path: ":nip?/:smh?/:pwd/foos/:id",
1849
+ parse: {
1850
+ id: Number,
1851
+ nip: Number,
1852
+ pwd: Number,
1853
+ smh: Number
1854
+ }
1993
1855
  }
1994
1856
  }
1995
1857
  }
1996
1858
  }
1997
- }
1998
- }, state = {
1999
- routes: [
2000
- {
1859
+ },
1860
+ state = {
1861
+ routes: [{
2001
1862
  name: "Foe",
2002
1863
  state: {
2003
1864
  index: 1,
2004
- routes: [
2005
- {
2006
- name: "Foo"
1865
+ routes: [{
1866
+ name: "Foo"
1867
+ }, {
1868
+ name: "Bas",
1869
+ params: {
1870
+ nip: 5,
1871
+ pwd: 10,
1872
+ id: 15
2007
1873
  },
2008
- {
2009
- name: "Bas",
2010
- params: {
2011
- nip: 5,
2012
- pwd: 10,
2013
- id: 15
2014
- },
2015
- path
2016
- }
2017
- ]
2018
- }
2019
- }
2020
- ]
2021
- };
2022
- (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)(path, config)).toEqual(state), (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)((0, import_getPathFromState.getPathFromState)(state, config), config)).toEqual(changePath(state, "/5/10/foos/15"));
2023
- });
2024
- import_vitest.test.skip("merges parent patterns if needed", function() {
2025
- var path = "foo/42/baz/babel", config = {
2026
- screens: {
2027
- Foo: {
2028
- path: "foo/:bar",
2029
- parse: {
2030
- bar: Number
2031
- },
2032
- screens: {
2033
- Baz: "baz/:qux"
1874
+ path
1875
+ }]
1876
+ }
1877
+ }]
1878
+ };
1879
+ (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)(path, config)).toEqual(state), (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)((0, import_getPathFromState.getPathFromState)(state, config), config)).toEqual(changePath(state, "/5/10/foos/15"));
1880
+ });
1881
+ import_vitest.test.skip("merges parent patterns if needed", function () {
1882
+ var path = "foo/42/baz/babel",
1883
+ config = {
1884
+ screens: {
1885
+ Foo: {
1886
+ path: "foo/:bar",
1887
+ parse: {
1888
+ bar: Number
1889
+ },
1890
+ screens: {
1891
+ Baz: "baz/:qux"
1892
+ }
2034
1893
  }
2035
1894
  }
2036
- }
2037
- }, state = {
2038
- routes: [
2039
- {
1895
+ },
1896
+ state = {
1897
+ routes: [{
2040
1898
  name: "Foo",
2041
1899
  params: {
2042
1900
  bar: 42
2043
1901
  },
2044
1902
  state: {
2045
- routes: [
2046
- {
2047
- name: "Baz",
2048
- params: {
2049
- qux: "babel"
2050
- },
2051
- path
2052
- }
2053
- ]
1903
+ routes: [{
1904
+ name: "Baz",
1905
+ params: {
1906
+ qux: "babel"
1907
+ },
1908
+ path
1909
+ }]
2054
1910
  }
2055
- }
2056
- ]
2057
- };
1911
+ }]
1912
+ };
2058
1913
  (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)(path, config)).toEqual(state), (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)((0, import_getPathFromState.getPathFromState)(state, config), config)).toEqual(changePath(state, "/foo/42/baz/babel"));
2059
1914
  });
2060
- import_vitest.test.skip("ignores extra slashes in the pattern", function() {
2061
- var path = "/bar/42", config = {
2062
- screens: {
2063
- Foo: {
2064
- screens: {
2065
- Bar: {
2066
- path: "/bar//:id/"
1915
+ import_vitest.test.skip("ignores extra slashes in the pattern", function () {
1916
+ var path = "/bar/42",
1917
+ config = {
1918
+ screens: {
1919
+ Foo: {
1920
+ screens: {
1921
+ Bar: {
1922
+ path: "/bar//:id/"
1923
+ }
2067
1924
  }
2068
1925
  }
2069
1926
  }
2070
- }
2071
- }, state = {
2072
- routes: [
2073
- {
1927
+ },
1928
+ state = {
1929
+ routes: [{
2074
1930
  name: "Foo",
2075
1931
  state: {
2076
- routes: [
2077
- {
2078
- name: "Bar",
2079
- params: {
2080
- id: "42"
2081
- },
2082
- path
2083
- }
2084
- ]
1932
+ routes: [{
1933
+ name: "Bar",
1934
+ params: {
1935
+ id: "42"
1936
+ },
1937
+ path
1938
+ }]
2085
1939
  }
2086
- }
2087
- ]
2088
- };
1940
+ }]
1941
+ };
2089
1942
  (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)(path, config)).toEqual(state), (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)((0, import_getPathFromState.getPathFromState)(state, config), config)).toEqual(state);
2090
1943
  });
2091
- import_vitest.test.skip("matches wildcard patterns at root", function() {
2092
- var path = "/test/bar/42/whatever", config = {
2093
- screens: {
2094
- 404: "*",
2095
- Foo: {
2096
- screens: {
2097
- Bar: {
2098
- path: "/bar/:id/"
1944
+ import_vitest.test.skip("matches wildcard patterns at root", function () {
1945
+ var path = "/test/bar/42/whatever",
1946
+ config = {
1947
+ screens: {
1948
+ 404: "*",
1949
+ Foo: {
1950
+ screens: {
1951
+ Bar: {
1952
+ path: "/bar/:id/"
1953
+ }
2099
1954
  }
2100
1955
  }
2101
1956
  }
2102
- }
2103
- }, state = {
2104
- routes: [
2105
- {
1957
+ },
1958
+ state = {
1959
+ routes: [{
2106
1960
  name: "404",
2107
1961
  path
2108
- }
2109
- ]
2110
- };
1962
+ }]
1963
+ };
2111
1964
  (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)(path, config)).toEqual(state), (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)((0, import_getPathFromState.getPathFromState)(state, config), config)).toEqual(changePath(state, "/404"));
2112
1965
  });
2113
- import_vitest.test.skip("matches wildcard patterns at nested level", function() {
2114
- var path = "/bar/42/whatever/baz/initt", config = {
2115
- screens: {
2116
- Foo: {
2117
- screens: {
2118
- Bar: {
2119
- path: "/bar/:id/",
2120
- screens: {
2121
- 404: "*"
1966
+ import_vitest.test.skip("matches wildcard patterns at nested level", function () {
1967
+ var path = "/bar/42/whatever/baz/initt",
1968
+ config = {
1969
+ screens: {
1970
+ Foo: {
1971
+ screens: {
1972
+ Bar: {
1973
+ path: "/bar/:id/",
1974
+ screens: {
1975
+ 404: "*"
1976
+ }
2122
1977
  }
2123
1978
  }
2124
1979
  }
2125
1980
  }
2126
- }
2127
- }, state = {
2128
- routes: [
2129
- {
1981
+ },
1982
+ state = {
1983
+ routes: [{
2130
1984
  name: "Foo",
2131
1985
  state: {
2132
- routes: [
2133
- {
2134
- name: "Bar",
2135
- params: {
2136
- id: "42"
2137
- },
2138
- state: {
2139
- routes: [
2140
- {
2141
- name: "404",
2142
- path
2143
- }
2144
- ]
2145
- }
1986
+ routes: [{
1987
+ name: "Bar",
1988
+ params: {
1989
+ id: "42"
1990
+ },
1991
+ state: {
1992
+ routes: [{
1993
+ name: "404",
1994
+ path
1995
+ }]
2146
1996
  }
2147
- ]
1997
+ }]
2148
1998
  }
2149
- }
2150
- ]
2151
- };
1999
+ }]
2000
+ };
2152
2001
  (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)(path, config)).toEqual(state), (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)((0, import_getPathFromState.getPathFromState)(state, config), config)).toEqual(changePath(state, "/bar/42/404"));
2153
2002
  });
2154
- import_vitest.test.skip("matches wildcard patterns at nested level with exact", function() {
2155
- var path = "/whatever", config = {
2156
- screens: {
2157
- Foo: {
2158
- screens: {
2159
- Bar: {
2160
- path: "/bar/:id/",
2161
- screens: {
2162
- 404: {
2163
- path: "*",
2164
- exact: !0
2003
+ import_vitest.test.skip("matches wildcard patterns at nested level with exact", function () {
2004
+ var path = "/whatever",
2005
+ config = {
2006
+ screens: {
2007
+ Foo: {
2008
+ screens: {
2009
+ Bar: {
2010
+ path: "/bar/:id/",
2011
+ screens: {
2012
+ 404: {
2013
+ path: "*",
2014
+ exact: !0
2015
+ }
2165
2016
  }
2166
- }
2167
- },
2168
- Baz: {}
2017
+ },
2018
+ Baz: {}
2019
+ }
2169
2020
  }
2170
2021
  }
2171
- }
2172
- }, state = {
2173
- routes: [
2174
- {
2022
+ },
2023
+ state = {
2024
+ routes: [{
2175
2025
  name: "Foo",
2176
2026
  state: {
2177
- routes: [
2178
- {
2179
- name: "Bar",
2180
- state: {
2181
- routes: [
2182
- {
2183
- name: "404",
2184
- path
2185
- }
2186
- ]
2187
- }
2188
- }
2189
- ]
2190
- }
2191
- }
2192
- ]
2193
- };
2027
+ routes: [{
2028
+ name: "Bar",
2029
+ state: {
2030
+ routes: [{
2031
+ name: "404",
2032
+ path
2033
+ }]
2034
+ }
2035
+ }]
2036
+ }
2037
+ }]
2038
+ };
2194
2039
  (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)(path, config)).toEqual(state), (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)((0, import_getPathFromState.getPathFromState)(state, config), config)).toEqual(changePath(state, "/404"));
2195
2040
  });
2196
- import_vitest.test.skip("tries to match wildcard patterns at the end", function() {
2197
- var path = "/bar/42/test", config = {
2198
- screens: {
2199
- Foo: {
2200
- screens: {
2201
- Bar: {
2202
- path: "/bar/:id/",
2203
- screens: {
2204
- 404: "*",
2205
- UserProfile: ":userSlug",
2206
- Test: "test"
2041
+ import_vitest.test.skip("tries to match wildcard patterns at the end", function () {
2042
+ var path = "/bar/42/test",
2043
+ config = {
2044
+ screens: {
2045
+ Foo: {
2046
+ screens: {
2047
+ Bar: {
2048
+ path: "/bar/:id/",
2049
+ screens: {
2050
+ 404: "*",
2051
+ UserProfile: ":userSlug",
2052
+ Test: "test"
2053
+ }
2207
2054
  }
2208
2055
  }
2209
2056
  }
2210
2057
  }
2211
- }
2212
- }, state = {
2213
- routes: [
2214
- {
2058
+ },
2059
+ state = {
2060
+ routes: [{
2215
2061
  name: "Foo",
2216
2062
  state: {
2217
- routes: [
2218
- {
2219
- name: "Bar",
2220
- params: {
2221
- id: "42"
2222
- },
2223
- state: {
2224
- routes: [
2225
- {
2226
- name: "Test",
2227
- path
2228
- }
2229
- ]
2230
- }
2063
+ routes: [{
2064
+ name: "Bar",
2065
+ params: {
2066
+ id: "42"
2067
+ },
2068
+ state: {
2069
+ routes: [{
2070
+ name: "Test",
2071
+ path
2072
+ }]
2231
2073
  }
2232
- ]
2074
+ }]
2233
2075
  }
2234
- }
2235
- ]
2236
- };
2076
+ }]
2077
+ };
2237
2078
  (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)(path, config)).toEqual(state), (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)((0, import_getPathFromState.getPathFromState)(state, config), config)).toEqual(state);
2238
2079
  });
2239
- import_vitest.test.skip("uses nearest parent wildcard match for unmatched paths", function() {
2240
- var path = "/bar/42/baz/test", config = {
2241
- screens: {
2242
- Foo: {
2243
- screens: {
2244
- Bar: {
2245
- path: "/bar/:id/",
2246
- screens: {
2247
- Baz: "baz"
2248
- }
2249
- },
2250
- 404: "*"
2080
+ import_vitest.test.skip("uses nearest parent wildcard match for unmatched paths", function () {
2081
+ var path = "/bar/42/baz/test",
2082
+ config = {
2083
+ screens: {
2084
+ Foo: {
2085
+ screens: {
2086
+ Bar: {
2087
+ path: "/bar/:id/",
2088
+ screens: {
2089
+ Baz: "baz"
2090
+ }
2091
+ },
2092
+ 404: "*"
2093
+ }
2251
2094
  }
2252
2095
  }
2253
- }
2254
- }, state = {
2255
- routes: [
2256
- {
2096
+ },
2097
+ state = {
2098
+ routes: [{
2257
2099
  name: "Foo",
2258
2100
  state: {
2259
- routes: [
2260
- {
2261
- name: "404",
2262
- path
2263
- }
2264
- ]
2101
+ routes: [{
2102
+ name: "404",
2103
+ path
2104
+ }]
2265
2105
  }
2266
- }
2267
- ]
2268
- };
2106
+ }]
2107
+ };
2269
2108
  (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)(path, config)).toEqual(state), (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)((0, import_getPathFromState.getPathFromState)(state, config), config)).toEqual(changePath(state, "/404"));
2270
2109
  });
2271
- import_vitest.test.skip("matches screen with overlapping initial path and wildcard", function() {
2272
- var path = "/bar/42/baz/test/whatever", config = {
2273
- screens: {
2274
- Foo: {
2275
- screens: {
2276
- Bar: {
2277
- path: "/bar/:id/",
2278
- screens: {
2279
- Baz: "baz"
2280
- }
2281
- },
2282
- Baz: "/bar/:id/*"
2110
+ import_vitest.test.skip("matches screen with overlapping initial path and wildcard", function () {
2111
+ var path = "/bar/42/baz/test/whatever",
2112
+ config = {
2113
+ screens: {
2114
+ Foo: {
2115
+ screens: {
2116
+ Bar: {
2117
+ path: "/bar/:id/",
2118
+ screens: {
2119
+ Baz: "baz"
2120
+ }
2121
+ },
2122
+ Baz: "/bar/:id/*"
2123
+ }
2283
2124
  }
2284
2125
  }
2285
- }
2286
- }, state = {
2287
- routes: [
2288
- {
2126
+ },
2127
+ state = {
2128
+ routes: [{
2289
2129
  name: "Foo",
2290
2130
  state: {
2291
- routes: [
2292
- {
2293
- name: "Baz",
2294
- params: {
2295
- id: "42"
2296
- },
2297
- path
2298
- }
2299
- ]
2131
+ routes: [{
2132
+ name: "Baz",
2133
+ params: {
2134
+ id: "42"
2135
+ },
2136
+ path
2137
+ }]
2300
2138
  }
2301
- }
2302
- ]
2303
- };
2139
+ }]
2140
+ };
2304
2141
  (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)(path, config)).toEqual(state), (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)((0, import_getPathFromState.getPathFromState)(state, config), config)).toEqual(changePath(state, "/bar/42/Baz"));
2305
2142
  });
2306
- (0, import_vitest.test)("throws if two screens map to the same pattern", function() {
2143
+ (0, import_vitest.test)("throws if two screens map to the same pattern", function () {
2307
2144
  var path = "/bar/42/baz/test";
2308
- (0, import_vitest.expect)(function() {
2145
+ (0, import_vitest.expect)(function () {
2309
2146
  return (0, import_getStateFromPath.getStateFromPath)(path, {
2310
2147
  screens: {
2311
2148
  Foo: {
@@ -2321,7 +2158,7 @@ import_vitest.test.skip("matches screen with overlapping initial path and wildca
2321
2158
  }
2322
2159
  }
2323
2160
  });
2324
- }).toThrow("Found conflicting screens with the same pattern. The pattern 'bar/:id/baz' resolves to both 'Foo > Bax' and 'Foo > Bar > Baz'. Patterns must be unique and cannot resolve to more than one screen."), (0, import_vitest.expect)(function() {
2161
+ }).toThrow("Found conflicting screens with the same pattern. The pattern 'bar/:id/baz' resolves to both 'Foo > Bax' and 'Foo > Bar > Baz'. Patterns must be unique and cannot resolve to more than one screen."), (0, import_vitest.expect)(function () {
2325
2162
  return (0, import_getStateFromPath.getStateFromPath)(path, {
2326
2163
  screens: {
2327
2164
  Foo: {
@@ -2338,106 +2175,97 @@ import_vitest.test.skip("matches screen with overlapping initial path and wildca
2338
2175
  });
2339
2176
  }).not.toThrow();
2340
2177
  });
2341
- (0, import_vitest.test)("correctly applies initialRouteName for config with similar route names", function() {
2342
- var path = "/weekly-earnings", config = {
2343
- screens: {
2344
- RootTabs: {
2345
- screens: {
2346
- HomeTab: {
2347
- screens: {
2348
- Home: "",
2349
- WeeklyEarnings: "weekly-earnings",
2350
- EventDetails: "event-details/:eventId"
2351
- }
2352
- },
2353
- EarningsTab: {
2354
- initialRouteName: "Earnings",
2355
- path: "earnings",
2356
- screens: {
2357
- Earnings: "",
2358
- WeeklyEarnings: "weekly-earnings"
2178
+ (0, import_vitest.test)("correctly applies initialRouteName for config with similar route names", function () {
2179
+ var path = "/weekly-earnings",
2180
+ config = {
2181
+ screens: {
2182
+ RootTabs: {
2183
+ screens: {
2184
+ HomeTab: {
2185
+ screens: {
2186
+ Home: "",
2187
+ WeeklyEarnings: "weekly-earnings",
2188
+ EventDetails: "event-details/:eventId"
2189
+ }
2190
+ },
2191
+ EarningsTab: {
2192
+ initialRouteName: "Earnings",
2193
+ path: "earnings",
2194
+ screens: {
2195
+ Earnings: "",
2196
+ WeeklyEarnings: "weekly-earnings"
2197
+ }
2359
2198
  }
2360
2199
  }
2361
2200
  }
2362
2201
  }
2363
- }
2364
- }, state = {
2365
- routes: [
2366
- {
2202
+ },
2203
+ state = {
2204
+ routes: [{
2367
2205
  name: "RootTabs",
2368
2206
  state: {
2369
- routes: [
2370
- {
2371
- name: "HomeTab",
2372
- state: {
2373
- routes: [
2374
- {
2375
- name: "WeeklyEarnings",
2376
- path
2377
- }
2378
- ]
2379
- }
2380
- }
2381
- ]
2382
- }
2383
- }
2384
- ]
2385
- };
2207
+ routes: [{
2208
+ name: "HomeTab",
2209
+ state: {
2210
+ routes: [{
2211
+ name: "WeeklyEarnings",
2212
+ path
2213
+ }]
2214
+ }
2215
+ }]
2216
+ }
2217
+ }]
2218
+ };
2386
2219
  (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)(path, config)).toEqual(state), (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)((0, import_getPathFromState.getPathFromState)(state, config), config)).toEqual(state);
2387
2220
  });
2388
- (0, import_vitest.test)("correctly applies initialRouteName for config with similar route names v2", function() {
2389
- var path = "/earnings/weekly-earnings", config = {
2390
- screens: {
2391
- RootTabs: {
2392
- screens: {
2393
- HomeTab: {
2394
- initialRouteName: "Home",
2395
- screens: {
2396
- Home: "",
2397
- WeeklyEarnings: "weekly-earnings"
2398
- }
2399
- },
2400
- EarningsTab: {
2401
- initialRouteName: "Earnings",
2402
- path: "earnings",
2403
- screens: {
2404
- Earnings: "",
2405
- WeeklyEarnings: "weekly-earnings"
2221
+ (0, import_vitest.test)("correctly applies initialRouteName for config with similar route names v2", function () {
2222
+ var path = "/earnings/weekly-earnings",
2223
+ config = {
2224
+ screens: {
2225
+ RootTabs: {
2226
+ screens: {
2227
+ HomeTab: {
2228
+ initialRouteName: "Home",
2229
+ screens: {
2230
+ Home: "",
2231
+ WeeklyEarnings: "weekly-earnings"
2232
+ }
2233
+ },
2234
+ EarningsTab: {
2235
+ initialRouteName: "Earnings",
2236
+ path: "earnings",
2237
+ screens: {
2238
+ Earnings: "",
2239
+ WeeklyEarnings: "weekly-earnings"
2240
+ }
2406
2241
  }
2407
2242
  }
2408
2243
  }
2409
2244
  }
2410
- }
2411
- }, state = {
2412
- routes: [
2413
- {
2245
+ },
2246
+ state = {
2247
+ routes: [{
2414
2248
  name: "RootTabs",
2415
2249
  state: {
2416
- routes: [
2417
- {
2418
- name: "EarningsTab",
2419
- state: {
2420
- index: 1,
2421
- routes: [
2422
- {
2423
- name: "Earnings"
2424
- },
2425
- {
2426
- name: "WeeklyEarnings",
2427
- path
2428
- }
2429
- ]
2430
- }
2431
- }
2432
- ]
2433
- }
2434
- }
2435
- ]
2436
- };
2250
+ routes: [{
2251
+ name: "EarningsTab",
2252
+ state: {
2253
+ index: 1,
2254
+ routes: [{
2255
+ name: "Earnings"
2256
+ }, {
2257
+ name: "WeeklyEarnings",
2258
+ path
2259
+ }]
2260
+ }
2261
+ }]
2262
+ }
2263
+ }]
2264
+ };
2437
2265
  (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)(path, config)).toEqual(state), (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)((0, import_getPathFromState.getPathFromState)(state, config), config)).toEqual(state);
2438
2266
  });
2439
- import_vitest.test.skip("throws when invalid properties are specified in the config", function() {
2440
- (0, import_vitest.expect)(function() {
2267
+ import_vitest.test.skip("throws when invalid properties are specified in the config", function () {
2268
+ (0, import_vitest.expect)(function () {
2441
2269
  return (0, import_getStateFromPath.getStateFromPath)("", {
2442
2270
  path: 42,
2443
2271
  Foo: "foo",
@@ -2459,7 +2287,7 @@ import_vitest.test.skip("throws when invalid properties are specified in the con
2459
2287
  If you want to specify configuration for screens, you need to specify them under a 'screens' property.
2460
2288
 
2461
2289
  See https://reactnavigation.org/docs/configuring-links for more details on how to specify a linking configuration."
2462
- `), (0, import_vitest.expect)(function() {
2290
+ `), (0, import_vitest.expect)(function () {
2463
2291
  return (0, import_getStateFromPath.getStateFromPath)("", {
2464
2292
  screens: {
2465
2293
  Foo: "foo",
@@ -2489,79 +2317,78 @@ You can only specify the following properties:
2489
2317
  If you want to specify configuration for screens, you need to specify them under a 'screens' property.
2490
2318
 
2491
2319
  See https://reactnavigation.org/docs/configuring-links for more details on how to specify a linking configuration."
2492
- `), (0, import_vitest.expect)(function() {
2320
+ `), (0, import_vitest.expect)(function () {
2493
2321
  return (0, import_getStateFromPath.getStateFromPath)("", {
2494
2322
  path: "foo/:id"
2495
2323
  });
2496
2324
  }).toThrowErrorMatchingInlineSnapshot(`"Found invalid path 'foo/:id'. The 'path' in the top-level configuration cannot contain patterns for params."`);
2497
2325
  });
2498
- import_vitest.test.skip("encodes special characters in params", function() {
2499
- var paramWithValidSymbols = "User09-A_Z~!$&'()*+,;=:@__", invalidSymbols = "#?[]{}%<>||", queryString = "user#email@gmail.com=2&4", path = `users/id/${paramWithValidSymbols}${encodeURIComponent(invalidSymbols)}?query=${encodeURIComponent(queryString)}`, config = {
2500
- path: "users",
2501
- screens: {
2502
- Users: {
2503
- screens: {
2504
- User: "id/:id"
2326
+ import_vitest.test.skip("encodes special characters in params", function () {
2327
+ var paramWithValidSymbols = "User09-A_Z~!$&'()*+,;=:@__",
2328
+ invalidSymbols = "#?[]{}%<>||",
2329
+ queryString = "user#email@gmail.com=2&4",
2330
+ path = `users/id/${paramWithValidSymbols}${encodeURIComponent(invalidSymbols)}?query=${encodeURIComponent(queryString)}`,
2331
+ config = {
2332
+ path: "users",
2333
+ screens: {
2334
+ Users: {
2335
+ screens: {
2336
+ User: "id/:id"
2337
+ }
2505
2338
  }
2506
2339
  }
2507
- }
2508
- }, state = {
2509
- routes: [
2510
- {
2340
+ },
2341
+ state = {
2342
+ routes: [{
2511
2343
  name: "Users",
2512
2344
  state: {
2513
- routes: [
2514
- {
2515
- name: "User",
2516
- params: {
2517
- id: `${paramWithValidSymbols}${invalidSymbols}`,
2518
- query: queryString
2519
- }
2345
+ routes: [{
2346
+ name: "User",
2347
+ params: {
2348
+ id: `${paramWithValidSymbols}${invalidSymbols}`,
2349
+ query: queryString
2520
2350
  }
2521
- ]
2351
+ }]
2522
2352
  }
2523
- }
2524
- ]
2525
- };
2353
+ }]
2354
+ };
2526
2355
  (0, import_vitest.expect)((0, import_getPathFromState.getPathFromState)(state, config)).toBe(`/${path}`), (0, import_vitest.expect)((0, import_getPathFromState.getPathFromState)((0, import_getStateFromPath.getStateFromPath)(path, config), config)).toBe(`/${path}`);
2527
2356
  });
2528
- import_vitest.test.skip("resolves nested path params with same name to correct screen", function() {
2529
- var path = "/foo/42/bar/43", config = {
2530
- initialRouteName: "Foo",
2531
- screens: {
2532
- Foo: {
2533
- path: "foo/:id",
2534
- screens: {
2535
- Bar: {
2536
- path: "bar/:id"
2357
+ import_vitest.test.skip("resolves nested path params with same name to correct screen", function () {
2358
+ var path = "/foo/42/bar/43",
2359
+ config = {
2360
+ initialRouteName: "Foo",
2361
+ screens: {
2362
+ Foo: {
2363
+ path: "foo/:id",
2364
+ screens: {
2365
+ Bar: {
2366
+ path: "bar/:id"
2367
+ }
2537
2368
  }
2538
2369
  }
2539
2370
  }
2540
- }
2541
- }, state = {
2542
- routes: [
2543
- {
2371
+ },
2372
+ state = {
2373
+ routes: [{
2544
2374
  name: "Foo",
2545
2375
  params: {
2546
2376
  id: "42"
2547
2377
  },
2548
2378
  state: {
2549
- routes: [
2550
- {
2551
- name: "Bar",
2552
- params: {
2553
- id: "43"
2554
- },
2555
- path
2556
- }
2557
- ]
2379
+ routes: [{
2380
+ name: "Bar",
2381
+ params: {
2382
+ id: "43"
2383
+ },
2384
+ path
2385
+ }]
2558
2386
  }
2559
- }
2560
- ]
2561
- };
2387
+ }]
2388
+ };
2562
2389
  (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)(path, config)).toEqual(state);
2563
2390
  });
2564
- (0, import_vitest.test)("parses / same as empty string", function() {
2391
+ (0, import_vitest.test)("parses / same as empty string", function () {
2565
2392
  var config = {
2566
2393
  screens: {
2567
2394
  Foo: {
@@ -2574,7 +2401,7 @@ import_vitest.test.skip("resolves nested path params with same name to correct s
2574
2401
  };
2575
2402
  (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)("/", config)).toEqual((0, import_getStateFromPath.getStateFromPath)("", config));
2576
2403
  });
2577
- import_vitest.test.skip("matches regexp patterns when provided", function() {
2404
+ import_vitest.test.skip("matches regexp patterns when provided", function () {
2578
2405
  var config = {
2579
2406
  screens: {
2580
2407
  Foo: {
@@ -2592,7 +2419,7 @@ import_vitest.test.skip("matches regexp patterns when provided", function() {
2592
2419
  Qux: {
2593
2420
  path: "foo/:id(@[a-z]+)",
2594
2421
  parse: {
2595
- id: function(id) {
2422
+ id: function (id) {
2596
2423
  return id.slice(1);
2597
2424
  }
2598
2425
  }
@@ -2612,93 +2439,75 @@ import_vitest.test.skip("matches regexp patterns when provided", function() {
2612
2439
  }
2613
2440
  };
2614
2441
  (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)("foo/42", config)).toEqual({
2615
- routes: [
2616
- {
2617
- name: "Foo",
2618
- params: {
2619
- id: 42
2620
- },
2621
- path: "foo/42"
2622
- }
2623
- ]
2442
+ routes: [{
2443
+ name: "Foo",
2444
+ params: {
2445
+ id: 42
2446
+ },
2447
+ path: "foo/42"
2448
+ }]
2624
2449
  }), (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)("foo/bar", config)).toEqual({
2625
- routes: [
2626
- {
2627
- name: "Bar",
2628
- params: {
2629
- id: "bar"
2630
- },
2631
- path: "foo/bar"
2632
- }
2633
- ]
2450
+ routes: [{
2451
+ name: "Bar",
2452
+ params: {
2453
+ id: "bar"
2454
+ },
2455
+ path: "foo/bar"
2456
+ }]
2634
2457
  }), (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)("foo/42/bar", config)).toEqual({
2635
- routes: [
2636
- {
2637
- name: "Baz",
2638
- params: {
2639
- id: "42",
2640
- name: "bar"
2641
- },
2642
- path: "foo/42/bar"
2643
- }
2644
- ]
2458
+ routes: [{
2459
+ name: "Baz",
2460
+ params: {
2461
+ id: "42",
2462
+ name: "bar"
2463
+ },
2464
+ path: "foo/42/bar"
2465
+ }]
2645
2466
  }), (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)("foo/@bar", config)).toEqual({
2646
- routes: [
2647
- {
2648
- name: "Qux",
2649
- params: {
2650
- id: "bar"
2651
- },
2652
- path: "foo/@bar"
2653
- }
2654
- ]
2467
+ routes: [{
2468
+ name: "Qux",
2469
+ params: {
2470
+ id: "bar"
2471
+ },
2472
+ path: "foo/@bar"
2473
+ }]
2655
2474
  }), (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)("foo/@bar", config)).toEqual({
2656
- routes: [
2657
- {
2658
- name: "Qux",
2659
- params: {
2660
- id: "bar"
2661
- },
2662
- path: "foo/@bar"
2663
- }
2664
- ]
2475
+ routes: [{
2476
+ name: "Qux",
2477
+ params: {
2478
+ id: "bar"
2479
+ },
2480
+ path: "foo/@bar"
2481
+ }]
2665
2482
  }), (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)("foo/42a", config)).toBeUndefined(), (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)("foo/bar/123", config)).toEqual({
2666
- routes: [
2667
- {
2668
- name: "Quy",
2669
- params: {
2670
- category: "123"
2671
- },
2672
- path: "foo/bar/123"
2673
- }
2674
- ]
2483
+ routes: [{
2484
+ name: "Quy",
2485
+ params: {
2486
+ category: "123"
2487
+ },
2488
+ path: "foo/bar/123"
2489
+ }]
2675
2490
  }), (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)("foo/bar/test", config)).toEqual({
2676
- routes: [
2677
- {
2678
- name: "Quz",
2679
- params: {
2680
- special: "test"
2681
- },
2682
- path: "foo/bar/test"
2683
- }
2684
- ]
2491
+ routes: [{
2492
+ name: "Quz",
2493
+ params: {
2494
+ special: "test"
2495
+ },
2496
+ path: "foo/bar/test"
2497
+ }]
2685
2498
  }), (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)("foo/bar/baz", config)).toEqual({
2686
- routes: [
2687
- {
2688
- name: "Quu",
2689
- path: "foo/bar/baz"
2690
- }
2691
- ]
2499
+ routes: [{
2500
+ name: "Quu",
2501
+ path: "foo/bar/baz"
2502
+ }]
2692
2503
  }), (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)("foo/bar/hello/world", config)).toEqual({
2693
- routes: [
2694
- {
2695
- name: "NotFound",
2696
- path: "foo/bar/hello/world"
2697
- }
2698
- ]
2504
+ routes: [{
2505
+ name: "NotFound",
2506
+ path: "foo/bar/hello/world"
2507
+ }]
2699
2508
  });
2700
2509
  });
2701
- (0, import_vitest.test)("regexp pattern doesn't match slash", function() {
2510
+ (0, import_vitest.test)("regexp pattern doesn't match slash", function () {
2702
2511
  var config = {
2703
2512
  screens: {
2704
2513
  Foo: {
@@ -2708,37 +2517,31 @@ import_vitest.test.skip("matches regexp patterns when provided", function() {
2708
2517
  };
2709
2518
  (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)("foo/bar/", config)).toBeUndefined(), (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)("foo/bar/baz", config)).toBeUndefined(), (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)("foo/bar/baz/qux", config)).toBeUndefined();
2710
2519
  });
2711
- import_vitest.test.skip("handles alias for paths", function() {
2520
+ import_vitest.test.skip("handles alias for paths", function () {
2712
2521
  var config = {
2713
2522
  screens: {
2714
2523
  Foo: {
2715
2524
  path: "foo",
2716
- alias: [
2717
- "first"
2718
- ],
2525
+ alias: ["first"],
2719
2526
  screens: {
2720
2527
  Baz: {
2721
2528
  path: "baz/:id?",
2722
2529
  parse: {
2723
- id: function(value) {
2530
+ id: function (value) {
2724
2531
  return value.replace(/@/, "");
2725
2532
  }
2726
2533
  },
2727
- alias: [
2728
- {
2729
- path: "second/:id",
2730
- exact: !0
2731
- },
2732
- "third",
2733
- {
2734
- path: "fourth/:id",
2735
- parse: {
2736
- id: function(value) {
2737
- return value.replace(/\$/, "");
2738
- }
2534
+ alias: [{
2535
+ path: "second/:id",
2536
+ exact: !0
2537
+ }, "third", {
2538
+ path: "fourth/:id",
2539
+ parse: {
2540
+ id: function (value) {
2541
+ return value.replace(/\$/, "");
2739
2542
  }
2740
2543
  }
2741
- ]
2544
+ }]
2742
2545
  },
2743
2546
  Qux: {
2744
2547
  path: "qux/:id"
@@ -2748,114 +2551,88 @@ import_vitest.test.skip("handles alias for paths", function() {
2748
2551
  }
2749
2552
  };
2750
2553
  (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)("foo", config)).toEqual({
2751
- routes: [
2752
- {
2753
- name: "Foo",
2754
- path: "foo"
2755
- }
2756
- ]
2554
+ routes: [{
2555
+ name: "Foo",
2556
+ path: "foo"
2557
+ }]
2757
2558
  }), (0, import_vitest.expect)((0, import_getPathFromState.getPathFromState)((0, import_getStateFromPath.getStateFromPath)("foo", config), config)).toBe("/foo"), (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)("first", config)).toEqual({
2758
- routes: [
2759
- {
2760
- name: "Foo",
2761
- path: "first"
2762
- }
2763
- ]
2559
+ routes: [{
2560
+ name: "Foo",
2561
+ path: "first"
2562
+ }]
2764
2563
  }), (0, import_vitest.expect)((0, import_getPathFromState.getPathFromState)((0, import_getStateFromPath.getStateFromPath)("first", config), config)).toBe("/foo"), (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)("foo/baz/@$test", config)).toEqual({
2765
- routes: [
2766
- {
2767
- name: "Foo",
2768
- state: {
2769
- routes: [
2770
- {
2771
- name: "Baz",
2772
- params: {
2773
- id: "$test"
2774
- },
2775
- path: "foo/baz/@$test"
2776
- }
2777
- ]
2778
- }
2564
+ routes: [{
2565
+ name: "Foo",
2566
+ state: {
2567
+ routes: [{
2568
+ name: "Baz",
2569
+ params: {
2570
+ id: "$test"
2571
+ },
2572
+ path: "foo/baz/@$test"
2573
+ }]
2779
2574
  }
2780
- ]
2575
+ }]
2781
2576
  }), (0, import_vitest.expect)((0, import_getPathFromState.getPathFromState)((0, import_getStateFromPath.getStateFromPath)("foo/baz/@$test", config), config)).toBe("/foo/baz/$test"), (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)("second/42", config)).toEqual({
2782
- routes: [
2783
- {
2784
- name: "Foo",
2785
- state: {
2786
- routes: [
2787
- {
2788
- name: "Baz",
2789
- params: {
2790
- id: "42"
2791
- },
2792
- path: "second/42"
2793
- }
2794
- ]
2795
- }
2577
+ routes: [{
2578
+ name: "Foo",
2579
+ state: {
2580
+ routes: [{
2581
+ name: "Baz",
2582
+ params: {
2583
+ id: "42"
2584
+ },
2585
+ path: "second/42"
2586
+ }]
2796
2587
  }
2797
- ]
2588
+ }]
2798
2589
  }), (0, import_vitest.expect)((0, import_getPathFromState.getPathFromState)((0, import_getStateFromPath.getStateFromPath)("second/42", config), config)).toBe("/foo/baz/42"), (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)("foo/third", config)).toEqual({
2799
- routes: [
2800
- {
2801
- name: "Foo",
2802
- state: {
2803
- routes: [
2804
- {
2805
- name: "Baz",
2806
- path: "foo/third"
2807
- }
2808
- ]
2809
- }
2810
- }
2811
- ]
2590
+ routes: [{
2591
+ name: "Foo",
2592
+ state: {
2593
+ routes: [{
2594
+ name: "Baz",
2595
+ path: "foo/third"
2596
+ }]
2597
+ }
2598
+ }]
2812
2599
  }), (0, import_vitest.expect)((0, import_getPathFromState.getPathFromState)((0, import_getStateFromPath.getStateFromPath)("foo/third", config), config)).toBe("/foo/baz"), (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)("foo/fourth/@$test", config)).toEqual({
2813
- routes: [
2814
- {
2815
- name: "Foo",
2816
- state: {
2817
- routes: [
2818
- {
2819
- name: "Baz",
2820
- params: {
2821
- id: "@test"
2822
- },
2823
- path: "foo/fourth/@$test"
2824
- }
2825
- ]
2826
- }
2600
+ routes: [{
2601
+ name: "Foo",
2602
+ state: {
2603
+ routes: [{
2604
+ name: "Baz",
2605
+ params: {
2606
+ id: "@test"
2607
+ },
2608
+ path: "foo/fourth/@$test"
2609
+ }]
2827
2610
  }
2828
- ]
2611
+ }]
2829
2612
  }), (0, import_vitest.expect)((0, import_getPathFromState.getPathFromState)((0, import_getStateFromPath.getStateFromPath)("foo/fourth/@$test", config), config)).toBe("/foo/baz/@test"), (0, import_vitest.expect)((0, import_getStateFromPath.getStateFromPath)("foo/qux/42", config)).toEqual({
2830
- routes: [
2831
- {
2832
- name: "Foo",
2833
- state: {
2834
- routes: [
2835
- {
2836
- name: "Qux",
2837
- params: {
2838
- id: "42"
2839
- },
2840
- path: "foo/qux/42"
2841
- }
2842
- ]
2843
- }
2613
+ routes: [{
2614
+ name: "Foo",
2615
+ state: {
2616
+ routes: [{
2617
+ name: "Qux",
2618
+ params: {
2619
+ id: "42"
2620
+ },
2621
+ path: "foo/qux/42"
2622
+ }]
2844
2623
  }
2845
- ]
2624
+ }]
2846
2625
  }), (0, import_vitest.expect)((0, import_getPathFromState.getPathFromState)((0, import_getStateFromPath.getStateFromPath)("foo/qux/42", config), config)).toBe("/foo/qux/42");
2847
2626
  });
2848
- import_vitest.test.skip("throws if screen has alias but no path", function() {
2849
- (0, import_vitest.expect)(function() {
2627
+ import_vitest.test.skip("throws if screen has alias but no path", function () {
2628
+ (0, import_vitest.expect)(function () {
2850
2629
  return (0, import_getStateFromPath.getStateFromPath)("", {
2851
2630
  screens: {
2852
2631
  Foo: {
2853
- alias: [
2854
- "bar"
2855
- ]
2632
+ alias: ["bar"]
2856
2633
  }
2857
2634
  }
2858
2635
  });
2859
2636
  }).toThrow("Screen 'Foo' doesn't specify a 'path'. A 'path' needs to be specified in order to use 'alias'.");
2860
2637
  });
2861
- //# sourceMappingURL=getStateFromPath.test.js.map
2638
+ //# sourceMappingURL=getStateFromPath.test.native.js.map