one 1.2.57 → 1.2.59
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.
- package/dist/cjs/cli/build.cjs +3 -1
- package/dist/cjs/cli/build.js +1 -1
- package/dist/cjs/cli/build.js.map +1 -1
- package/dist/cjs/cli/build.native.js +13 -12
- package/dist/cjs/cli/build.native.js.map +1 -1
- package/dist/cjs/cli/buildPage.cjs +1 -1
- package/dist/cjs/cli/buildPage.js +1 -1
- package/dist/cjs/cli/buildPage.native.js +2 -2
- package/dist/cjs/cli/buildPage.native.js.map +1 -1
- package/dist/cjs/cli/dev.cjs +4 -4
- package/dist/cjs/cli/dev.js +4 -4
- package/dist/cjs/cli/dev.js.map +1 -1
- package/dist/cjs/cli/dev.native.js +4 -4
- package/dist/cjs/cli/dev.native.js.map +1 -1
- package/dist/cjs/cli/generateRoutes.cjs +1 -1
- package/dist/cjs/cli/generateRoutes.js +1 -1
- package/dist/cjs/cli/generateRoutes.native.js +1 -1
- package/dist/cjs/cli/generateRoutes.native.js.map +1 -1
- package/dist/cjs/cli/generateSitemap.native.js +7 -7
- package/dist/cjs/cli/generateSitemap.native.js.map +1 -1
- package/dist/cjs/config.native.js +2 -2
- package/dist/cjs/config.native.js.map +1 -1
- package/dist/cjs/constants.native.js +1 -1
- package/dist/cjs/constants.native.js.map +1 -1
- package/dist/cjs/createApp.cjs +2 -1
- package/dist/cjs/createApp.js +2 -2
- package/dist/cjs/createApp.js.map +1 -1
- package/dist/cjs/createHandleRequest.test.js +3 -1
- package/dist/cjs/createHandleRequest.test.js.map +1 -1
- package/dist/cjs/createHandleRequest.test.native.js.map +1 -1
- package/dist/cjs/devtools/registry.cjs +30 -0
- package/dist/cjs/devtools/registry.js +25 -0
- package/dist/cjs/devtools/registry.js.map +6 -0
- package/dist/cjs/devtools/registry.native.js +33 -0
- package/dist/cjs/devtools/registry.native.js.map +1 -0
- package/dist/cjs/fork/NavigationContainer.native.js +5 -5
- package/dist/cjs/fork/NavigationContainer.native.js.map +1 -1
- package/dist/cjs/fork/createMemoryHistory.cjs +20 -9
- package/dist/cjs/fork/createMemoryHistory.js +22 -4
- package/dist/cjs/fork/createMemoryHistory.js.map +1 -1
- package/dist/cjs/fork/createMemoryHistory.native.js +22 -11
- package/dist/cjs/fork/createMemoryHistory.native.js.map +1 -1
- package/dist/cjs/fork/extractPathFromURL.native.js +8 -8
- package/dist/cjs/fork/extractPathFromURL.native.js.map +1 -1
- package/dist/cjs/fork/findFocusedRoute.native.js +2 -3
- package/dist/cjs/fork/findFocusedRoute.native.js.map +1 -1
- package/dist/cjs/fork/getPathFromState-mods.native.js +2 -3
- package/dist/cjs/fork/getPathFromState-mods.native.js.map +1 -1
- package/dist/cjs/fork/getStateFromPath-mods.native.js +3 -3
- package/dist/cjs/fork/getStateFromPath-mods.native.js.map +1 -1
- package/dist/cjs/fork/useLinking.cjs +11 -5
- package/dist/cjs/fork/useLinking.js +6 -6
- package/dist/cjs/fork/useLinking.js.map +1 -1
- package/dist/cjs/fork/useLinking.native.js.map +1 -1
- package/dist/cjs/head/url.native.js +2 -3
- package/dist/cjs/head/url.native.js.map +1 -1
- package/dist/cjs/hooks.js.map +1 -1
- package/dist/cjs/hooks.native.js.map +1 -1
- package/dist/cjs/index.cjs +17 -1
- package/dist/cjs/index.js +12 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/index.native.js +17 -1
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/layouts/withLayoutContext.cjs +34 -15
- package/dist/cjs/layouts/withLayoutContext.js +29 -13
- package/dist/cjs/layouts/withLayoutContext.js.map +1 -1
- package/dist/cjs/layouts/withLayoutContext.native.js +42 -19
- package/dist/cjs/layouts/withLayoutContext.native.js.map +1 -1
- package/dist/cjs/link/Link.cjs +5 -2
- package/dist/cjs/link/Link.js +3 -2
- package/dist/cjs/link/Link.js.map +1 -1
- package/dist/cjs/link/Link.native.js +6 -1
- package/dist/cjs/link/Link.native.js.map +1 -1
- package/dist/cjs/link/href.native.js +2 -2
- package/dist/cjs/link/href.native.js.map +1 -1
- package/dist/cjs/link/useLinkTo.cjs +11 -3
- package/dist/cjs/link/useLinkTo.js +6 -3
- package/dist/cjs/link/useLinkTo.js.map +1 -1
- package/dist/cjs/link/useLinkTo.native.js +11 -3
- package/dist/cjs/link/useLinkTo.native.js.map +1 -1
- package/dist/cjs/router/Route.js.map +1 -1
- package/dist/cjs/router/Route.native.js.map +1 -1
- package/dist/cjs/router/findRouteNode.cjs +70 -0
- package/dist/cjs/router/findRouteNode.js +72 -0
- package/dist/cjs/router/findRouteNode.js.map +6 -0
- package/dist/cjs/router/findRouteNode.native.js +104 -0
- package/dist/cjs/router/findRouteNode.native.js.map +1 -0
- package/dist/cjs/router/getRoutes.native.js +3 -3
- package/dist/cjs/router/getRoutes.native.js.map +1 -1
- package/dist/cjs/router/router.cjs +160 -11
- package/dist/cjs/router/router.js +142 -7
- package/dist/cjs/router/router.js.map +2 -2
- package/dist/cjs/router/router.native.js +247 -67
- package/dist/cjs/router/router.native.js.map +1 -1
- package/dist/cjs/router/useNavigation.js.map +1 -1
- package/dist/cjs/router/useNavigation.native.js.map +1 -1
- package/dist/cjs/router/useScreens.cjs +1 -1
- package/dist/cjs/router/useScreens.js +1 -1
- package/dist/cjs/router/useScreens.js.map +1 -1
- package/dist/cjs/router/useScreens.native.js +6 -3
- package/dist/cjs/router/useScreens.native.js.map +1 -1
- package/dist/cjs/router/utils/getNavigateAction.native.js +2 -4
- package/dist/cjs/router/utils/getNavigateAction.native.js.map +1 -1
- package/dist/cjs/server/oneServe.js.map +1 -1
- package/dist/cjs/server/oneServe.native.js +4 -4
- package/dist/cjs/server/oneServe.native.js.map +1 -1
- package/dist/cjs/server/setupBuildOptions.native.js +1 -1
- package/dist/cjs/server/setupBuildOptions.native.js.map +1 -1
- package/dist/cjs/ui/common.native.js +6 -5
- package/dist/cjs/ui/common.native.js.map +1 -1
- package/dist/cjs/useBlocker.cjs +158 -0
- package/dist/cjs/useBlocker.js +145 -0
- package/dist/cjs/useBlocker.js.map +6 -0
- package/dist/cjs/useBlocker.native.js +89 -0
- package/dist/cjs/useBlocker.native.js.map +1 -0
- package/dist/cjs/useFocusEffect.cjs +2 -2
- package/dist/cjs/useFocusEffect.js +2 -2
- package/dist/cjs/useFocusEffect.js.map +1 -1
- package/dist/cjs/useFocusEffect.native.js +2 -2
- package/dist/cjs/useFocusEffect.native.js.map +1 -1
- package/dist/cjs/useLoader.cjs +69 -3
- package/dist/cjs/useLoader.js +57 -4
- package/dist/cjs/useLoader.js.map +2 -2
- package/dist/cjs/useLoader.native.js +90 -6
- package/dist/cjs/useLoader.native.js.map +1 -1
- package/dist/cjs/useScrollGroup.cjs +37 -0
- package/dist/cjs/useScrollGroup.js +30 -0
- package/dist/cjs/useScrollGroup.js.map +6 -0
- package/dist/cjs/useScrollGroup.native.js +29 -0
- package/dist/cjs/useScrollGroup.native.js.map +1 -0
- package/dist/cjs/validateParams.cjs +80 -0
- package/dist/cjs/validateParams.js +84 -0
- package/dist/cjs/validateParams.js.map +6 -0
- package/dist/cjs/validateParams.native.js +180 -0
- package/dist/cjs/validateParams.native.js.map +1 -0
- package/dist/cjs/validateSearch.cjs +104 -0
- package/dist/cjs/validateSearch.js +99 -0
- package/dist/cjs/validateSearch.js.map +6 -0
- package/dist/cjs/validateSearch.native.js +202 -0
- package/dist/cjs/validateSearch.native.js.map +1 -0
- package/dist/cjs/vercel/build/buildVercelOutputDirectory.native.js +2 -2
- package/dist/cjs/vercel/build/buildVercelOutputDirectory.native.js.map +1 -1
- package/dist/cjs/views/ErrorBoundary.cjs +293 -10
- package/dist/cjs/views/ErrorBoundary.js +328 -8
- package/dist/cjs/views/ErrorBoundary.js.map +2 -2
- package/dist/cjs/views/ErrorBoundary.native.js +159 -4
- package/dist/cjs/views/ErrorBoundary.native.js.map +1 -1
- package/dist/cjs/views/Navigator.cjs +10 -3
- package/dist/cjs/views/Navigator.js +11 -3
- package/dist/cjs/views/Navigator.js.map +1 -1
- package/dist/cjs/views/Navigator.native.js +15 -6
- package/dist/cjs/views/Navigator.native.js.map +1 -1
- package/dist/cjs/views/Protected.cjs +36 -0
- package/dist/cjs/views/Protected.js +27 -0
- package/dist/cjs/views/Protected.js.map +6 -0
- package/dist/cjs/views/Protected.native.js +44 -0
- package/dist/cjs/views/Protected.native.js.map +1 -0
- package/dist/cjs/views/RootErrorBoundary.cjs +193 -8
- package/dist/cjs/views/RootErrorBoundary.js +213 -8
- package/dist/cjs/views/RootErrorBoundary.js.map +1 -1
- package/dist/cjs/views/RootErrorBoundary.native.js +192 -8
- package/dist/cjs/views/RootErrorBoundary.native.js.map +1 -1
- package/dist/cjs/views/ScrollBehavior.cjs +49 -11
- package/dist/cjs/views/ScrollBehavior.js +47 -11
- package/dist/cjs/views/ScrollBehavior.js.map +1 -1
- package/dist/cjs/views/ScrollBehavior.native.js +68 -10
- package/dist/cjs/views/ScrollBehavior.native.js.map +1 -1
- package/dist/cjs/views/SourceInspector.cjs +28 -0
- package/dist/cjs/views/SourceInspector.js +23 -0
- package/dist/cjs/views/SourceInspector.js.map +6 -0
- package/dist/cjs/views/SourceInspector.native.js +32 -0
- package/dist/cjs/views/SourceInspector.native.js.map +1 -0
- package/dist/cjs/views/Try.cjs +40 -7
- package/dist/cjs/views/Try.js +38 -4
- package/dist/cjs/views/Try.js.map +1 -1
- package/dist/cjs/views/Try.native.js +42 -7
- package/dist/cjs/views/Try.native.js.map +1 -1
- package/dist/cjs/vite/DevHead.cjs +797 -43
- package/dist/cjs/vite/DevHead.js +802 -51
- package/dist/cjs/vite/DevHead.js.map +1 -1
- package/dist/cjs/vite/DevHead.native.js +783 -1
- package/dist/cjs/vite/DevHead.native.js.map +1 -1
- package/dist/cjs/vite/one.cjs +7 -1
- package/dist/cjs/vite/one.js +7 -2
- package/dist/cjs/vite/one.js.map +1 -1
- package/dist/cjs/vite/one.native.js +17 -7
- package/dist/cjs/vite/one.native.js.map +1 -1
- package/dist/cjs/vite/plugins/SSRCSSPlugin.cjs +44 -4
- package/dist/cjs/vite/plugins/SSRCSSPlugin.js +48 -4
- package/dist/cjs/vite/plugins/SSRCSSPlugin.js.map +1 -1
- package/dist/cjs/vite/plugins/SSRCSSPlugin.native.js +62 -5
- package/dist/cjs/vite/plugins/SSRCSSPlugin.native.js.map +1 -1
- package/dist/cjs/vite/plugins/clientTreeShakePlugin.cjs +34 -15
- package/dist/cjs/vite/plugins/clientTreeShakePlugin.js +24 -3
- package/dist/cjs/vite/plugins/clientTreeShakePlugin.js.map +1 -1
- package/dist/cjs/vite/plugins/clientTreeShakePlugin.native.js +55 -19
- package/dist/cjs/vite/plugins/clientTreeShakePlugin.native.js.map +1 -1
- package/dist/cjs/vite/plugins/clientTreeShakePlugin.test.cjs +129 -0
- package/dist/cjs/vite/plugins/clientTreeShakePlugin.test.js +129 -0
- package/dist/cjs/vite/plugins/clientTreeShakePlugin.test.js.map +6 -0
- package/dist/cjs/vite/plugins/clientTreeShakePlugin.test.native.js +140 -0
- package/dist/cjs/vite/plugins/clientTreeShakePlugin.test.native.js.map +1 -0
- package/dist/cjs/vite/plugins/fileSystemRouterPlugin.js +6 -3
- package/dist/cjs/vite/plugins/fileSystemRouterPlugin.js.map +1 -1
- package/dist/cjs/vite/plugins/fileSystemRouterPlugin.native.js +3 -3
- package/dist/cjs/vite/plugins/fileSystemRouterPlugin.native.js.map +1 -1
- package/dist/cjs/vite/plugins/generateFileSystemRouteTypesPlugin.cjs +5 -1
- package/dist/cjs/vite/plugins/generateFileSystemRouteTypesPlugin.js +11 -6
- package/dist/cjs/vite/plugins/generateFileSystemRouteTypesPlugin.js.map +1 -1
- package/dist/cjs/vite/plugins/generateFileSystemRouteTypesPlugin.native.js +1 -0
- package/dist/cjs/vite/plugins/generateFileSystemRouteTypesPlugin.native.js.map +1 -1
- package/dist/cjs/vite/plugins/sourceInspectorPlugin.cjs +155 -0
- package/dist/cjs/vite/plugins/sourceInspectorPlugin.js +148 -0
- package/dist/cjs/vite/plugins/sourceInspectorPlugin.js.map +6 -0
- package/dist/cjs/vite/plugins/sourceInspectorPlugin.native.js +231 -0
- package/dist/cjs/vite/plugins/sourceInspectorPlugin.native.js.map +1 -0
- package/dist/cjs/vite/plugins/virtualEntryPlugin.cjs +25 -6
- package/dist/cjs/vite/plugins/virtualEntryPlugin.js +16 -6
- package/dist/cjs/vite/plugins/virtualEntryPlugin.js.map +1 -1
- package/dist/cjs/vite/plugins/virtualEntryPlugin.native.js +26 -7
- package/dist/cjs/vite/plugins/virtualEntryPlugin.native.js.map +1 -1
- package/dist/esm/cli/build.js +1 -1
- package/dist/esm/cli/build.js.map +1 -1
- package/dist/esm/cli/build.mjs +3 -1
- package/dist/esm/cli/build.mjs.map +1 -1
- package/dist/esm/cli/build.native.js +13 -12
- package/dist/esm/cli/build.native.js.map +1 -1
- package/dist/esm/cli/buildPage.js +1 -1
- package/dist/esm/cli/buildPage.mjs +1 -1
- package/dist/esm/cli/buildPage.mjs.map +1 -1
- package/dist/esm/cli/buildPage.native.js +2 -2
- package/dist/esm/cli/buildPage.native.js.map +1 -1
- package/dist/esm/cli/dev.js +4 -4
- package/dist/esm/cli/dev.js.map +1 -1
- package/dist/esm/cli/dev.mjs +4 -4
- package/dist/esm/cli/dev.mjs.map +1 -1
- package/dist/esm/cli/dev.native.js +4 -4
- package/dist/esm/cli/dev.native.js.map +1 -1
- package/dist/esm/cli/generateRoutes.js +1 -1
- package/dist/esm/cli/generateRoutes.mjs +1 -1
- package/dist/esm/cli/generateRoutes.mjs.map +1 -1
- package/dist/esm/cli/generateRoutes.native.js +1 -1
- package/dist/esm/cli/generateRoutes.native.js.map +1 -1
- package/dist/esm/cli/generateSitemap.native.js +7 -7
- package/dist/esm/cli/generateSitemap.native.js.map +1 -1
- package/dist/esm/config.native.js +2 -2
- package/dist/esm/config.native.js.map +1 -1
- package/dist/esm/constants.native.js +2 -2
- package/dist/esm/constants.native.js.map +1 -1
- package/dist/esm/createApp.js +2 -2
- package/dist/esm/createApp.js.map +1 -1
- package/dist/esm/createApp.mjs +2 -1
- package/dist/esm/createApp.mjs.map +1 -1
- package/dist/esm/createHandleRequest.test.js +3 -1
- package/dist/esm/createHandleRequest.test.js.map +1 -1
- package/dist/esm/createHandleRequest.test.mjs.map +1 -1
- package/dist/esm/createHandleRequest.test.native.js.map +1 -1
- package/dist/esm/devtools/registry.js +9 -0
- package/dist/esm/devtools/registry.js.map +6 -0
- package/dist/esm/devtools/registry.mjs +6 -0
- package/dist/esm/devtools/registry.mjs.map +1 -0
- package/dist/esm/devtools/registry.native.js +6 -0
- package/dist/esm/devtools/registry.native.js.map +1 -0
- package/dist/esm/fork/NavigationContainer.native.js +5 -5
- package/dist/esm/fork/NavigationContainer.native.js.map +1 -1
- package/dist/esm/fork/createMemoryHistory.js +22 -4
- package/dist/esm/fork/createMemoryHistory.js.map +1 -1
- package/dist/esm/fork/createMemoryHistory.mjs +20 -9
- package/dist/esm/fork/createMemoryHistory.mjs.map +1 -1
- package/dist/esm/fork/createMemoryHistory.native.js +22 -11
- package/dist/esm/fork/createMemoryHistory.native.js.map +1 -1
- package/dist/esm/fork/extractPathFromURL.native.js +8 -8
- package/dist/esm/fork/extractPathFromURL.native.js.map +1 -1
- package/dist/esm/fork/findFocusedRoute.native.js +2 -3
- package/dist/esm/fork/findFocusedRoute.native.js.map +1 -1
- package/dist/esm/fork/getPathFromState-mods.native.js +2 -3
- package/dist/esm/fork/getPathFromState-mods.native.js.map +1 -1
- package/dist/esm/fork/getStateFromPath-mods.native.js +3 -3
- package/dist/esm/fork/getStateFromPath-mods.native.js.map +1 -1
- package/dist/esm/fork/useLinking.js +6 -5
- package/dist/esm/fork/useLinking.js.map +1 -1
- package/dist/esm/fork/useLinking.mjs +11 -5
- package/dist/esm/fork/useLinking.mjs.map +1 -1
- package/dist/esm/fork/useLinking.native.js.map +1 -1
- package/dist/esm/head/url.native.js +2 -3
- package/dist/esm/head/url.native.js.map +1 -1
- package/dist/esm/hooks.js.map +1 -1
- package/dist/esm/hooks.mjs.map +1 -1
- package/dist/esm/hooks.native.js.map +1 -1
- package/dist/esm/index.js +30 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.mjs +8 -2
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/index.native.js +8 -2
- package/dist/esm/index.native.js.map +1 -1
- package/dist/esm/layouts/withLayoutContext.js +30 -12
- package/dist/esm/layouts/withLayoutContext.js.map +1 -1
- package/dist/esm/layouts/withLayoutContext.mjs +34 -15
- package/dist/esm/layouts/withLayoutContext.mjs.map +1 -1
- package/dist/esm/layouts/withLayoutContext.native.js +42 -19
- package/dist/esm/layouts/withLayoutContext.native.js.map +1 -1
- package/dist/esm/link/Link.js +3 -2
- package/dist/esm/link/Link.js.map +1 -1
- package/dist/esm/link/Link.mjs +5 -2
- package/dist/esm/link/Link.mjs.map +1 -1
- package/dist/esm/link/Link.native.js +6 -1
- package/dist/esm/link/Link.native.js.map +1 -1
- package/dist/esm/link/href.native.js +2 -2
- package/dist/esm/link/href.native.js.map +1 -1
- package/dist/esm/link/useLinkTo.js +6 -3
- package/dist/esm/link/useLinkTo.js.map +1 -1
- package/dist/esm/link/useLinkTo.mjs +11 -3
- package/dist/esm/link/useLinkTo.mjs.map +1 -1
- package/dist/esm/link/useLinkTo.native.js +11 -3
- package/dist/esm/link/useLinkTo.native.js.map +1 -1
- package/dist/esm/router/Route.js.map +1 -1
- package/dist/esm/router/Route.mjs.map +1 -1
- package/dist/esm/router/Route.native.js.map +1 -1
- package/dist/esm/router/findRouteNode.js +56 -0
- package/dist/esm/router/findRouteNode.js.map +6 -0
- package/dist/esm/router/findRouteNode.mjs +44 -0
- package/dist/esm/router/findRouteNode.mjs.map +1 -0
- package/dist/esm/router/findRouteNode.native.js +75 -0
- package/dist/esm/router/findRouteNode.native.js.map +1 -0
- package/dist/esm/router/getRoutes.native.js +3 -3
- package/dist/esm/router/getRoutes.native.js.map +1 -1
- package/dist/esm/router/router.js +154 -6
- package/dist/esm/router/router.js.map +1 -1
- package/dist/esm/router/router.mjs +151 -10
- package/dist/esm/router/router.mjs.map +1 -1
- package/dist/esm/router/router.native.js +238 -66
- package/dist/esm/router/router.native.js.map +1 -1
- package/dist/esm/router/useNavigation.js.map +1 -1
- package/dist/esm/router/useNavigation.mjs.map +1 -1
- package/dist/esm/router/useNavigation.native.js.map +1 -1
- package/dist/esm/router/useScreens.js +1 -1
- package/dist/esm/router/useScreens.js.map +1 -1
- package/dist/esm/router/useScreens.mjs +1 -1
- package/dist/esm/router/useScreens.mjs.map +1 -1
- package/dist/esm/router/useScreens.native.js +6 -3
- package/dist/esm/router/useScreens.native.js.map +1 -1
- package/dist/esm/router/utils/getNavigateAction.native.js +2 -4
- package/dist/esm/router/utils/getNavigateAction.native.js.map +1 -1
- package/dist/esm/server/oneServe.js.map +1 -1
- package/dist/esm/server/oneServe.mjs.map +1 -1
- package/dist/esm/server/oneServe.native.js +4 -4
- package/dist/esm/server/oneServe.native.js.map +1 -1
- package/dist/esm/server/setupBuildOptions.native.js +1 -1
- package/dist/esm/server/setupBuildOptions.native.js.map +1 -1
- package/dist/esm/ui/common.native.js +6 -5
- package/dist/esm/ui/common.native.js.map +1 -1
- package/dist/esm/useBlocker.js +122 -0
- package/dist/esm/useBlocker.js.map +6 -0
- package/dist/esm/useBlocker.mjs +123 -0
- package/dist/esm/useBlocker.mjs.map +1 -0
- package/dist/esm/useBlocker.native.js +51 -0
- package/dist/esm/useBlocker.native.js.map +1 -0
- package/dist/esm/useFocusEffect.js +2 -2
- package/dist/esm/useFocusEffect.js.map +1 -1
- package/dist/esm/useFocusEffect.mjs +2 -2
- package/dist/esm/useFocusEffect.mjs.map +1 -1
- package/dist/esm/useFocusEffect.native.js +2 -2
- package/dist/esm/useFocusEffect.native.js.map +1 -1
- package/dist/esm/useLoader.js +57 -3
- package/dist/esm/useLoader.js.map +2 -2
- package/dist/esm/useLoader.mjs +69 -4
- package/dist/esm/useLoader.mjs.map +1 -1
- package/dist/esm/useLoader.native.js +90 -7
- package/dist/esm/useLoader.native.js.map +1 -1
- package/dist/esm/useScrollGroup.js +16 -0
- package/dist/esm/useScrollGroup.js.map +6 -0
- package/dist/esm/useScrollGroup.mjs +14 -0
- package/dist/esm/useScrollGroup.mjs.map +1 -0
- package/dist/esm/useScrollGroup.native.js +3 -0
- package/dist/esm/useScrollGroup.native.js.map +1 -0
- package/dist/esm/validateParams.js +68 -0
- package/dist/esm/validateParams.js.map +6 -0
- package/dist/esm/validateParams.mjs +54 -0
- package/dist/esm/validateParams.mjs.map +1 -0
- package/dist/esm/validateParams.native.js +151 -0
- package/dist/esm/validateParams.native.js.map +1 -0
- package/dist/esm/validateSearch.js +83 -0
- package/dist/esm/validateSearch.js.map +6 -0
- package/dist/esm/validateSearch.mjs +77 -0
- package/dist/esm/validateSearch.mjs.map +1 -0
- package/dist/esm/validateSearch.native.js +172 -0
- package/dist/esm/validateSearch.native.js.map +1 -0
- package/dist/esm/vercel/build/buildVercelOutputDirectory.native.js +2 -2
- package/dist/esm/vercel/build/buildVercelOutputDirectory.native.js.map +1 -1
- package/dist/esm/views/ErrorBoundary.js +325 -7
- package/dist/esm/views/ErrorBoundary.js.map +2 -2
- package/dist/esm/views/ErrorBoundary.mjs +289 -6
- package/dist/esm/views/ErrorBoundary.mjs.map +1 -1
- package/dist/esm/views/ErrorBoundary.native.js +159 -4
- package/dist/esm/views/ErrorBoundary.native.js.map +1 -1
- package/dist/esm/views/Navigator.js +11 -2
- package/dist/esm/views/Navigator.js.map +1 -1
- package/dist/esm/views/Navigator.mjs +10 -3
- package/dist/esm/views/Navigator.mjs.map +1 -1
- package/dist/esm/views/Navigator.native.js +15 -6
- package/dist/esm/views/Navigator.native.js.map +1 -1
- package/dist/esm/views/Protected.js +14 -0
- package/dist/esm/views/Protected.js.map +6 -0
- package/dist/esm/views/Protected.mjs +11 -0
- package/dist/esm/views/Protected.mjs.map +1 -0
- package/dist/esm/views/Protected.native.js +16 -0
- package/dist/esm/views/Protected.native.js.map +1 -0
- package/dist/esm/views/RootErrorBoundary.js +214 -7
- package/dist/esm/views/RootErrorBoundary.js.map +1 -1
- package/dist/esm/views/RootErrorBoundary.mjs +192 -7
- package/dist/esm/views/RootErrorBoundary.mjs.map +1 -1
- package/dist/esm/views/RootErrorBoundary.native.js +191 -7
- package/dist/esm/views/RootErrorBoundary.native.js.map +1 -1
- package/dist/esm/views/ScrollBehavior.js +47 -11
- package/dist/esm/views/ScrollBehavior.js.map +1 -1
- package/dist/esm/views/ScrollBehavior.mjs +48 -11
- package/dist/esm/views/ScrollBehavior.mjs.map +1 -1
- package/dist/esm/views/ScrollBehavior.native.js +67 -10
- package/dist/esm/views/ScrollBehavior.native.js.map +1 -1
- package/dist/esm/views/SourceInspector.js +7 -0
- package/dist/esm/views/SourceInspector.js.map +6 -0
- package/dist/esm/views/SourceInspector.mjs +5 -0
- package/dist/esm/views/SourceInspector.mjs.map +1 -0
- package/dist/esm/views/SourceInspector.native.js +6 -0
- package/dist/esm/views/SourceInspector.native.js.map +1 -0
- package/dist/esm/views/Try.js +38 -4
- package/dist/esm/views/Try.js.map +1 -1
- package/dist/esm/views/Try.mjs +40 -7
- package/dist/esm/views/Try.mjs.map +1 -1
- package/dist/esm/views/Try.native.js +42 -7
- package/dist/esm/views/Try.native.js.map +1 -1
- package/dist/esm/vite/DevHead.js +802 -51
- package/dist/esm/vite/DevHead.js.map +1 -1
- package/dist/esm/vite/DevHead.mjs +797 -43
- package/dist/esm/vite/DevHead.mjs.map +1 -1
- package/dist/esm/vite/DevHead.native.js +782 -0
- package/dist/esm/vite/DevHead.native.js.map +1 -1
- package/dist/esm/vite/one.js +7 -1
- package/dist/esm/vite/one.js.map +1 -1
- package/dist/esm/vite/one.mjs +7 -1
- package/dist/esm/vite/one.mjs.map +1 -1
- package/dist/esm/vite/one.native.js +17 -7
- package/dist/esm/vite/one.native.js.map +1 -1
- package/dist/esm/vite/plugins/SSRCSSPlugin.js +48 -4
- package/dist/esm/vite/plugins/SSRCSSPlugin.js.map +1 -1
- package/dist/esm/vite/plugins/SSRCSSPlugin.mjs +44 -4
- package/dist/esm/vite/plugins/SSRCSSPlugin.mjs.map +1 -1
- package/dist/esm/vite/plugins/SSRCSSPlugin.native.js +61 -4
- package/dist/esm/vite/plugins/SSRCSSPlugin.native.js.map +1 -1
- package/dist/esm/vite/plugins/clientTreeShakePlugin.js +24 -3
- package/dist/esm/vite/plugins/clientTreeShakePlugin.js.map +1 -1
- package/dist/esm/vite/plugins/clientTreeShakePlugin.mjs +34 -15
- package/dist/esm/vite/plugins/clientTreeShakePlugin.mjs.map +1 -1
- package/dist/esm/vite/plugins/clientTreeShakePlugin.native.js +55 -19
- package/dist/esm/vite/plugins/clientTreeShakePlugin.native.js.map +1 -1
- package/dist/esm/vite/plugins/clientTreeShakePlugin.test.js +130 -0
- package/dist/esm/vite/plugins/clientTreeShakePlugin.test.js.map +6 -0
- package/dist/esm/vite/plugins/clientTreeShakePlugin.test.mjs +130 -0
- package/dist/esm/vite/plugins/clientTreeShakePlugin.test.mjs.map +1 -0
- package/dist/esm/vite/plugins/clientTreeShakePlugin.test.native.js +138 -0
- package/dist/esm/vite/plugins/clientTreeShakePlugin.test.native.js.map +1 -0
- package/dist/esm/vite/plugins/fileSystemRouterPlugin.js +6 -3
- package/dist/esm/vite/plugins/fileSystemRouterPlugin.js.map +1 -1
- package/dist/esm/vite/plugins/fileSystemRouterPlugin.mjs.map +1 -1
- package/dist/esm/vite/plugins/fileSystemRouterPlugin.native.js +3 -3
- package/dist/esm/vite/plugins/fileSystemRouterPlugin.native.js.map +1 -1
- package/dist/esm/vite/plugins/generateFileSystemRouteTypesPlugin.js +11 -6
- package/dist/esm/vite/plugins/generateFileSystemRouteTypesPlugin.js.map +1 -1
- package/dist/esm/vite/plugins/generateFileSystemRouteTypesPlugin.mjs +5 -1
- package/dist/esm/vite/plugins/generateFileSystemRouteTypesPlugin.mjs.map +1 -1
- package/dist/esm/vite/plugins/generateFileSystemRouteTypesPlugin.native.js +1 -0
- package/dist/esm/vite/plugins/generateFileSystemRouteTypesPlugin.native.js.map +1 -1
- package/dist/esm/vite/plugins/sourceInspectorPlugin.js +126 -0
- package/dist/esm/vite/plugins/sourceInspectorPlugin.js.map +6 -0
- package/dist/esm/vite/plugins/sourceInspectorPlugin.mjs +121 -0
- package/dist/esm/vite/plugins/sourceInspectorPlugin.mjs.map +1 -0
- package/dist/esm/vite/plugins/sourceInspectorPlugin.native.js +194 -0
- package/dist/esm/vite/plugins/sourceInspectorPlugin.native.js.map +1 -0
- package/dist/esm/vite/plugins/virtualEntryPlugin.js +16 -6
- package/dist/esm/vite/plugins/virtualEntryPlugin.js.map +1 -1
- package/dist/esm/vite/plugins/virtualEntryPlugin.mjs +25 -6
- package/dist/esm/vite/plugins/virtualEntryPlugin.mjs.map +1 -1
- package/dist/esm/vite/plugins/virtualEntryPlugin.native.js +26 -7
- package/dist/esm/vite/plugins/virtualEntryPlugin.native.js.map +1 -1
- package/package.json +16 -14
- package/src/cli/build.ts +1 -1
- package/src/cli/buildPage.ts +1 -1
- package/src/cli/dev.ts +4 -4
- package/src/cli/generateRoutes.ts +1 -1
- package/src/createApp.tsx +11 -1
- package/src/createHandleRequest.test.ts +3 -1
- package/src/devtools/registry.ts +21 -0
- package/src/fork/createMemoryHistory.tsx +43 -11
- package/src/fork/useLinking.ts +14 -4
- package/src/hooks.tsx +71 -21
- package/src/index.ts +34 -1
- package/src/interfaces/router.ts +48 -0
- package/src/layouts/withLayoutContext.tsx +48 -8
- package/src/link/Link.tsx +7 -2
- package/src/link/useLinkTo.tsx +7 -3
- package/src/router/Route.tsx +32 -3
- package/src/router/findRouteNode.ts +127 -0
- package/src/router/router.ts +291 -2
- package/src/router/useNavigation.ts +12 -3
- package/src/router/useScreens.tsx +9 -3
- package/src/useBlocker.native.ts +153 -0
- package/src/useBlocker.ts +340 -0
- package/src/useFocusEffect.ts +18 -5
- package/src/useLoader.ts +193 -2
- package/src/useScrollGroup.native.ts +7 -0
- package/src/useScrollGroup.ts +35 -0
- package/src/validateParams.ts +196 -0
- package/src/validateSearch.ts +241 -0
- package/src/views/ErrorBoundary.tsx +154 -156
- package/src/views/ErrorBoundary.web.tsx +321 -0
- package/src/views/Navigator.tsx +18 -2
- package/src/views/Protected.tsx +62 -0
- package/src/views/RootErrorBoundary.tsx +214 -17
- package/src/views/ScrollBehavior.tsx +82 -3
- package/src/views/SourceInspector.tsx +39 -0
- package/src/views/Try.tsx +81 -12
- package/src/vite/DevHead.tsx +819 -54
- package/src/vite/one.ts +13 -0
- package/src/vite/plugins/SSRCSSPlugin.ts +104 -0
- package/src/vite/plugins/clientTreeShakePlugin.test.ts +174 -0
- package/src/vite/plugins/clientTreeShakePlugin.ts +50 -4
- package/src/vite/plugins/fileSystemRouterPlugin.tsx +11 -8
- package/src/vite/plugins/generateFileSystemRouteTypesPlugin.tsx +4 -0
- package/src/vite/plugins/sourceInspectorPlugin.ts +246 -0
- package/src/vite/plugins/virtualEntryPlugin.ts +36 -10
- package/src/vite/types.ts +28 -0
- package/types/createApp.d.ts +5 -0
- package/types/createApp.d.ts.map +1 -1
- package/types/devtools/registry.d.ts +15 -0
- package/types/devtools/registry.d.ts.map +1 -0
- package/types/fork/createMemoryHistory.d.ts +8 -3
- package/types/fork/createMemoryHistory.d.ts.map +1 -1
- package/types/fork/useLinking.d.ts.map +1 -1
- package/types/hooks.d.ts +71 -20
- package/types/hooks.d.ts.map +1 -1
- package/types/index.d.ts +8 -1
- package/types/index.d.ts.map +1 -1
- package/types/interfaces/router.d.ts +47 -0
- package/types/interfaces/router.d.ts.map +1 -1
- package/types/layouts/Drawer.d.ts +15 -11
- package/types/layouts/Drawer.d.ts.map +1 -1
- package/types/layouts/withLayoutContext.d.ts +2 -1
- package/types/layouts/withLayoutContext.d.ts.map +1 -1
- package/types/link/Link.d.ts.map +1 -1
- package/types/link/useLinkTo.d.ts +1 -0
- package/types/link/useLinkTo.d.ts.map +1 -1
- package/types/router/Route.d.ts +32 -3
- package/types/router/Route.d.ts.map +1 -1
- package/types/router/findRouteNode.d.ts +31 -0
- package/types/router/findRouteNode.d.ts.map +1 -0
- package/types/router/router.d.ts +35 -0
- package/types/router/router.d.ts.map +1 -1
- package/types/router/useNavigation.d.ts +12 -3
- package/types/router/useNavigation.d.ts.map +1 -1
- package/types/router/useScreens.d.ts +2 -0
- package/types/router/useScreens.d.ts.map +1 -1
- package/types/server/oneServe.d.ts.map +1 -1
- package/types/ui/TabContext.d.ts +1 -1
- package/types/ui/TabContext.d.ts.map +1 -1
- package/types/ui/Tabs.d.ts +2 -2
- package/types/ui/Tabs.d.ts.map +1 -1
- package/types/useBlocker.d.ts +72 -0
- package/types/useBlocker.d.ts.map +1 -0
- package/types/useBlocker.native.d.ts +60 -0
- package/types/useBlocker.native.d.ts.map +1 -0
- package/types/useFocusEffect.d.ts +17 -4
- package/types/useFocusEffect.d.ts.map +1 -1
- package/types/useLoader.d.ts +63 -0
- package/types/useLoader.d.ts.map +1 -1
- package/types/useScrollGroup.d.ts +18 -0
- package/types/useScrollGroup.d.ts.map +1 -0
- package/types/useScrollGroup.native.d.ts +6 -0
- package/types/useScrollGroup.native.d.ts.map +1 -0
- package/types/validateParams.d.ts +85 -0
- package/types/validateParams.d.ts.map +1 -0
- package/types/validateSearch.d.ts +107 -0
- package/types/validateSearch.d.ts.map +1 -0
- package/types/views/ErrorBoundary.d.ts +11 -1
- package/types/views/ErrorBoundary.d.ts.map +1 -1
- package/types/views/ErrorBoundary.web.d.ts +13 -0
- package/types/views/ErrorBoundary.web.d.ts.map +1 -0
- package/types/views/Navigator.d.ts.map +1 -1
- package/types/views/Protected.d.ts +39 -0
- package/types/views/Protected.d.ts.map +1 -0
- package/types/views/RootErrorBoundary.d.ts +14 -8
- package/types/views/RootErrorBoundary.d.ts.map +1 -1
- package/types/views/ScrollBehavior.d.ts +8 -0
- package/types/views/ScrollBehavior.d.ts.map +1 -1
- package/types/views/SourceInspector.d.ts +35 -0
- package/types/views/SourceInspector.d.ts.map +1 -0
- package/types/views/Try.d.ts +29 -6
- package/types/views/Try.d.ts.map +1 -1
- package/types/vite/DevHead.d.ts.map +1 -1
- package/types/vite/one.d.ts.map +1 -1
- package/types/vite/plugins/SSRCSSPlugin.d.ts.map +1 -1
- package/types/vite/plugins/clientTreeShakePlugin.d.ts.map +1 -1
- package/types/vite/plugins/clientTreeShakePlugin.test.d.ts +2 -0
- package/types/vite/plugins/clientTreeShakePlugin.test.d.ts.map +1 -0
- package/types/vite/plugins/fileSystemRouterPlugin.d.ts.map +1 -1
- package/types/vite/plugins/generateFileSystemRouteTypesPlugin.d.ts.map +1 -1
- package/types/vite/plugins/sourceInspectorPlugin.d.ts +3 -0
- package/types/vite/plugins/sourceInspectorPlugin.d.ts.map +1 -0
- package/types/vite/plugins/virtualEntryPlugin.d.ts.map +1 -1
- package/types/vite/types.d.ts +24 -0
- package/types/vite/types.d.ts.map +1 -1
- package/types/env.d.ts +0 -66
- /package/types/vercel/build/generate/{createSSRServerlessFunction.d.ts → createSsrServerlessFunction.d.ts} +0 -0
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: !0
|
|
11
|
+
});
|
|
12
|
+
},
|
|
13
|
+
__copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
15
|
+
get: () => from[key],
|
|
16
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
+
});
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
21
|
+
value: !0
|
|
22
|
+
}), mod);
|
|
23
|
+
var validateParams_exports = {};
|
|
24
|
+
__export(validateParams_exports, {
|
|
25
|
+
ParamValidationError: () => ParamValidationError,
|
|
26
|
+
RouteValidationError: () => RouteValidationError,
|
|
27
|
+
validateParams: () => validateParams,
|
|
28
|
+
zodParamValidator: () => zodParamValidator
|
|
29
|
+
});
|
|
30
|
+
module.exports = __toCommonJS(validateParams_exports);
|
|
31
|
+
function _assert_this_initialized(self) {
|
|
32
|
+
if (self === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
33
|
+
return self;
|
|
34
|
+
}
|
|
35
|
+
function _call_super(_this, derived, args) {
|
|
36
|
+
return derived = _get_prototype_of(derived), _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
|
|
37
|
+
}
|
|
38
|
+
function _class_call_check(instance, Constructor) {
|
|
39
|
+
if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
|
|
40
|
+
}
|
|
41
|
+
function _construct(Parent, args, Class) {
|
|
42
|
+
return _is_native_reflect_construct() ? _construct = Reflect.construct : _construct = function (Parent2, args2, Class2) {
|
|
43
|
+
var a = [null];
|
|
44
|
+
a.push.apply(a, args2);
|
|
45
|
+
var Constructor = Function.bind.apply(Parent2, a),
|
|
46
|
+
instance = new Constructor();
|
|
47
|
+
return Class2 && _set_prototype_of(instance, Class2.prototype), instance;
|
|
48
|
+
}, _construct.apply(null, arguments);
|
|
49
|
+
}
|
|
50
|
+
function _define_property(obj, key, value) {
|
|
51
|
+
return key in obj ? Object.defineProperty(obj, key, {
|
|
52
|
+
value,
|
|
53
|
+
enumerable: !0,
|
|
54
|
+
configurable: !0,
|
|
55
|
+
writable: !0
|
|
56
|
+
}) : obj[key] = value, obj;
|
|
57
|
+
}
|
|
58
|
+
function _get_prototype_of(o) {
|
|
59
|
+
return _get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function (o2) {
|
|
60
|
+
return o2.__proto__ || Object.getPrototypeOf(o2);
|
|
61
|
+
}, _get_prototype_of(o);
|
|
62
|
+
}
|
|
63
|
+
function _inherits(subClass, superClass) {
|
|
64
|
+
if (typeof superClass != "function" && superClass !== null) throw new TypeError("Super expression must either be null or a function");
|
|
65
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
66
|
+
constructor: {
|
|
67
|
+
value: subClass,
|
|
68
|
+
writable: !0,
|
|
69
|
+
configurable: !0
|
|
70
|
+
}
|
|
71
|
+
}), superClass && _set_prototype_of(subClass, superClass);
|
|
72
|
+
}
|
|
73
|
+
function _is_native_function(fn) {
|
|
74
|
+
return Function.toString.call(fn).indexOf("[native code]") !== -1;
|
|
75
|
+
}
|
|
76
|
+
function _possible_constructor_return(self, call) {
|
|
77
|
+
return call && (_type_of(call) === "object" || typeof call == "function") ? call : _assert_this_initialized(self);
|
|
78
|
+
}
|
|
79
|
+
function _set_prototype_of(o, p) {
|
|
80
|
+
return _set_prototype_of = Object.setPrototypeOf || function (o2, p2) {
|
|
81
|
+
return o2.__proto__ = p2, o2;
|
|
82
|
+
}, _set_prototype_of(o, p);
|
|
83
|
+
}
|
|
84
|
+
function _type_of(obj) {
|
|
85
|
+
"@swc/helpers - typeof";
|
|
86
|
+
|
|
87
|
+
return obj && typeof Symbol < "u" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
88
|
+
}
|
|
89
|
+
function _wrap_native_super(Class) {
|
|
90
|
+
var _cache = typeof Map == "function" ? /* @__PURE__ */new Map() : void 0;
|
|
91
|
+
return _wrap_native_super = function (Class2) {
|
|
92
|
+
if (Class2 === null || !_is_native_function(Class2)) return Class2;
|
|
93
|
+
if (typeof Class2 != "function") throw new TypeError("Super expression must either be null or a function");
|
|
94
|
+
if (typeof _cache < "u") {
|
|
95
|
+
if (_cache.has(Class2)) return _cache.get(Class2);
|
|
96
|
+
_cache.set(Class2, Wrapper);
|
|
97
|
+
}
|
|
98
|
+
function Wrapper() {
|
|
99
|
+
return _construct(Class2, arguments, _get_prototype_of(this).constructor);
|
|
100
|
+
}
|
|
101
|
+
return Wrapper.prototype = Object.create(Class2.prototype, {
|
|
102
|
+
constructor: {
|
|
103
|
+
value: Wrapper,
|
|
104
|
+
enumerable: !1,
|
|
105
|
+
writable: !0,
|
|
106
|
+
configurable: !0
|
|
107
|
+
}
|
|
108
|
+
}), _set_prototype_of(Wrapper, Class2);
|
|
109
|
+
}, _wrap_native_super(Class);
|
|
110
|
+
}
|
|
111
|
+
function _is_native_reflect_construct() {
|
|
112
|
+
try {
|
|
113
|
+
var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
114
|
+
} catch {}
|
|
115
|
+
return (_is_native_reflect_construct = function () {
|
|
116
|
+
return !!result;
|
|
117
|
+
})();
|
|
118
|
+
}
|
|
119
|
+
var ParamValidationError = /* @__PURE__ */function (Error1) {
|
|
120
|
+
"use strict";
|
|
121
|
+
|
|
122
|
+
_inherits(ParamValidationError2, Error1);
|
|
123
|
+
function ParamValidationError2(message, params) {
|
|
124
|
+
var issues = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [];
|
|
125
|
+
_class_call_check(this, ParamValidationError2);
|
|
126
|
+
var _this;
|
|
127
|
+
return _this = _call_super(this, ParamValidationError2, [message]), _define_property(_this, "routerCode", "VALIDATE_PARAMS"), _define_property(_this, "issues", void 0), _define_property(_this, "params", void 0), _this.name = "ParamValidationError", _this.params = params, _this.issues = issues, _this;
|
|
128
|
+
}
|
|
129
|
+
return ParamValidationError2;
|
|
130
|
+
}(_wrap_native_super(Error)),
|
|
131
|
+
RouteValidationError = /* @__PURE__ */function (Error1) {
|
|
132
|
+
"use strict";
|
|
133
|
+
|
|
134
|
+
_inherits(RouteValidationError2, Error1);
|
|
135
|
+
function RouteValidationError2(message, details) {
|
|
136
|
+
_class_call_check(this, RouteValidationError2);
|
|
137
|
+
var _this;
|
|
138
|
+
return _this = _call_super(this, RouteValidationError2, [message]), _define_property(_this, "routerCode", "VALIDATE_ROUTE"), _define_property(_this, "details", void 0), _this.name = "RouteValidationError", _this.details = details, _this;
|
|
139
|
+
}
|
|
140
|
+
return RouteValidationError2;
|
|
141
|
+
}(_wrap_native_super(Error));
|
|
142
|
+
function isStandardSchema(value) {
|
|
143
|
+
var _value_standard;
|
|
144
|
+
return (typeof value > "u" ? "undefined" : _type_of(value)) === "object" && value !== null && "~standard" in value && typeof ((_value_standard = value["~standard"]) === null || _value_standard === void 0 ? void 0 : _value_standard.validate) == "function";
|
|
145
|
+
}
|
|
146
|
+
function isZodLikeSchema(value) {
|
|
147
|
+
return (typeof value > "u" ? "undefined" : _type_of(value)) === "object" && value !== null && typeof value.parse == "function";
|
|
148
|
+
}
|
|
149
|
+
function isValidatorFn(value) {
|
|
150
|
+
return typeof value == "function";
|
|
151
|
+
}
|
|
152
|
+
function validateParams(validator, input) {
|
|
153
|
+
if (isStandardSchema(validator)) {
|
|
154
|
+
var result = validator["~standard"].validate(input);
|
|
155
|
+
if (result.issues) throw new ParamValidationError("Route param validation failed", input, result.issues);
|
|
156
|
+
return result.value;
|
|
157
|
+
}
|
|
158
|
+
if (isZodLikeSchema(validator)) {
|
|
159
|
+
if (validator.safeParse) {
|
|
160
|
+
var result1 = validator.safeParse(input);
|
|
161
|
+
if (!result1.success) throw new ParamValidationError("Route param validation failed", input, [result1.error]);
|
|
162
|
+
return result1.data;
|
|
163
|
+
}
|
|
164
|
+
try {
|
|
165
|
+
return validator.parse(input);
|
|
166
|
+
} catch (error) {
|
|
167
|
+
throw new ParamValidationError("Route param validation failed", input, [error]);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
if (isValidatorFn(validator)) try {
|
|
171
|
+
return validator(input);
|
|
172
|
+
} catch (error) {
|
|
173
|
+
throw new ParamValidationError("Route param validation failed", input, [error]);
|
|
174
|
+
}
|
|
175
|
+
throw new Error("Invalid validator provided to validateParams");
|
|
176
|
+
}
|
|
177
|
+
function zodParamValidator(schema) {
|
|
178
|
+
return schema;
|
|
179
|
+
}
|
|
180
|
+
//# sourceMappingURL=validateParams.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","validateParams_exports","__export","ParamValidationError","RouteValidationError","validateParams","zodParamValidator","module","exports","_assert_this_initialized","self","ReferenceError","_call_super","_this","derived","args","_get_prototype_of","_possible_constructor_return","_is_native_reflect_construct","Reflect","construct","constructor","apply","_class_call_check","instance","Constructor","TypeError","_construct","Parent","Class","Parent2","args2","Class2","a","push","Function","bind","_set_prototype_of","prototype","arguments","_define_property","obj","key","Object","defineProperty","enumerable","configurable","writable","o","setPrototypeOf","getPrototypeOf","o2","__proto__","_inherits","subClass","superClass","create","_is_native_function","fn","toString","call","indexOf","_type_of","p","p2","Symbol"],"sources":["../../src/validateParams.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,sBAAA;AAAAC,QAAA,CAAAD,sBAAA;EAAAE,oBAAA,EAAAA,CAAA,KAAAA,oBAAA;EAAAC,oBAAA,EAAAA,CAAA,KAAAA,oBAAA;EAAAC,cAAA,EAAAA,CAAA,KAAAA,cAAA;EAAAC,iBAAA,EAAAA,CAAA,KAAAA;AAAA;AA6COC,MAAM,CAAAC,OAAA,GAAAZ,YAAA,CAAAK,sBAAmC;AAAA,SACrCQ,wBAAaA,CAAAC,IAAA;EACb,IAAAA,IAAA,aACA,UAAAC,cAAA;EAET,OAAAD,IAAA;AACE;AAGc,SAChBE,YAAAC,KAAA,EAAAC,OAAA,EAAAC,IAAA;EACF,OAAAD,OAAA,GAAAE,iBAAA,CAAAF,OAAA,GAAAG,4BAAA,CAAAJ,K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
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all) __defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: !0
|
|
9
|
+
});
|
|
10
|
+
},
|
|
11
|
+
__copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
13
|
+
get: () => from[key],
|
|
14
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
|
+
});
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
19
|
+
value: !0
|
|
20
|
+
}), mod);
|
|
21
|
+
var validateSearch_exports = {};
|
|
22
|
+
__export(validateSearch_exports, {
|
|
23
|
+
SearchValidationError: () => SearchValidationError,
|
|
24
|
+
parseSearchString: () => parseSearchString,
|
|
25
|
+
validateSearch: () => validateSearch,
|
|
26
|
+
withFallback: () => withFallback,
|
|
27
|
+
zodSearchValidator: () => zodSearchValidator
|
|
28
|
+
});
|
|
29
|
+
module.exports = __toCommonJS(validateSearch_exports);
|
|
30
|
+
class SearchValidationError extends Error {
|
|
31
|
+
routerCode = "VALIDATE_SEARCH";
|
|
32
|
+
issues;
|
|
33
|
+
constructor(message, issues = []) {
|
|
34
|
+
super(message), this.name = "SearchValidationError", this.issues = issues;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
function isStandardSchema(value) {
|
|
38
|
+
return typeof value == "object" && value !== null && "~standard" in value && typeof value["~standard"]?.validate == "function";
|
|
39
|
+
}
|
|
40
|
+
function isZodLikeSchema(value) {
|
|
41
|
+
return typeof value == "object" && value !== null && typeof value.parse == "function";
|
|
42
|
+
}
|
|
43
|
+
function isValidatorFn(value) {
|
|
44
|
+
return typeof value == "function";
|
|
45
|
+
}
|
|
46
|
+
function parseSearchString(search) {
|
|
47
|
+
const params = {};
|
|
48
|
+
return new URLSearchParams(search).forEach((value, key) => {
|
|
49
|
+
const existing = params[key];
|
|
50
|
+
existing === void 0 ? params[key] = value : Array.isArray(existing) ? existing.push(value) : params[key] = [existing, value];
|
|
51
|
+
}), params;
|
|
52
|
+
}
|
|
53
|
+
function validateSearch(validator, input) {
|
|
54
|
+
if (isStandardSchema(validator)) {
|
|
55
|
+
const result = validator["~standard"].validate(input);
|
|
56
|
+
if (result.issues) throw new SearchValidationError("Search param validation failed", result.issues);
|
|
57
|
+
return result.value;
|
|
58
|
+
}
|
|
59
|
+
if (isZodLikeSchema(validator)) {
|
|
60
|
+
if (validator.safeParse) {
|
|
61
|
+
const result = validator.safeParse(input);
|
|
62
|
+
if (!result.success) throw new SearchValidationError("Search param validation failed", [result.error]);
|
|
63
|
+
return result.data;
|
|
64
|
+
}
|
|
65
|
+
try {
|
|
66
|
+
return validator.parse(input);
|
|
67
|
+
} catch (error) {
|
|
68
|
+
throw new SearchValidationError("Search param validation failed", [error]);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
if (isValidatorFn(validator)) try {
|
|
72
|
+
return validator(input);
|
|
73
|
+
} catch (error) {
|
|
74
|
+
throw new SearchValidationError("Search param validation failed", [error]);
|
|
75
|
+
}
|
|
76
|
+
throw new Error("Invalid validator provided to validateSearch");
|
|
77
|
+
}
|
|
78
|
+
function zodSearchValidator(schema) {
|
|
79
|
+
return schema;
|
|
80
|
+
}
|
|
81
|
+
function withFallback(schema, fallbackValue) {
|
|
82
|
+
return {
|
|
83
|
+
parse(value) {
|
|
84
|
+
try {
|
|
85
|
+
return schema.parse(value);
|
|
86
|
+
} catch {
|
|
87
|
+
return fallbackValue;
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
safeParse(value) {
|
|
91
|
+
try {
|
|
92
|
+
return {
|
|
93
|
+
success: !0,
|
|
94
|
+
data: schema.parse(value)
|
|
95
|
+
};
|
|
96
|
+
} catch {
|
|
97
|
+
return {
|
|
98
|
+
success: !0,
|
|
99
|
+
data: fallbackValue
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
8
|
+
}, __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
10
|
+
for (let key of __getOwnPropNames(from))
|
|
11
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
15
|
+
var validateSearch_exports = {};
|
|
16
|
+
__export(validateSearch_exports, {
|
|
17
|
+
SearchValidationError: () => SearchValidationError,
|
|
18
|
+
parseSearchString: () => parseSearchString,
|
|
19
|
+
validateSearch: () => validateSearch,
|
|
20
|
+
withFallback: () => withFallback,
|
|
21
|
+
zodSearchValidator: () => zodSearchValidator
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(validateSearch_exports);
|
|
24
|
+
class SearchValidationError extends Error {
|
|
25
|
+
routerCode = "VALIDATE_SEARCH";
|
|
26
|
+
issues;
|
|
27
|
+
constructor(message, issues = []) {
|
|
28
|
+
super(message), this.name = "SearchValidationError", this.issues = issues;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
function isStandardSchema(value) {
|
|
32
|
+
return typeof value == "object" && value !== null && "~standard" in value && typeof value["~standard"]?.validate == "function";
|
|
33
|
+
}
|
|
34
|
+
function isZodLikeSchema(value) {
|
|
35
|
+
return typeof value == "object" && value !== null && typeof value.parse == "function";
|
|
36
|
+
}
|
|
37
|
+
function isValidatorFn(value) {
|
|
38
|
+
return typeof value == "function";
|
|
39
|
+
}
|
|
40
|
+
function parseSearchString(search) {
|
|
41
|
+
const params = {};
|
|
42
|
+
return new URLSearchParams(search).forEach((value, key) => {
|
|
43
|
+
const existing = params[key];
|
|
44
|
+
existing === void 0 ? params[key] = value : Array.isArray(existing) ? existing.push(value) : params[key] = [existing, value];
|
|
45
|
+
}), params;
|
|
46
|
+
}
|
|
47
|
+
function validateSearch(validator, input) {
|
|
48
|
+
if (isStandardSchema(validator)) {
|
|
49
|
+
const result = validator["~standard"].validate(input);
|
|
50
|
+
if (result.issues)
|
|
51
|
+
throw new SearchValidationError(
|
|
52
|
+
"Search param validation failed",
|
|
53
|
+
result.issues
|
|
54
|
+
);
|
|
55
|
+
return result.value;
|
|
56
|
+
}
|
|
57
|
+
if (isZodLikeSchema(validator)) {
|
|
58
|
+
if (validator.safeParse) {
|
|
59
|
+
const result = validator.safeParse(input);
|
|
60
|
+
if (!result.success)
|
|
61
|
+
throw new SearchValidationError("Search param validation failed", [result.error]);
|
|
62
|
+
return result.data;
|
|
63
|
+
}
|
|
64
|
+
try {
|
|
65
|
+
return validator.parse(input);
|
|
66
|
+
} catch (error) {
|
|
67
|
+
throw new SearchValidationError("Search param validation failed", [error]);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
if (isValidatorFn(validator))
|
|
71
|
+
try {
|
|
72
|
+
return validator(input);
|
|
73
|
+
} catch (error) {
|
|
74
|
+
throw new SearchValidationError("Search param validation failed", [error]);
|
|
75
|
+
}
|
|
76
|
+
throw new Error("Invalid validator provided to validateSearch");
|
|
77
|
+
}
|
|
78
|
+
function zodSearchValidator(schema) {
|
|
79
|
+
return schema;
|
|
80
|
+
}
|
|
81
|
+
function withFallback(schema, fallbackValue) {
|
|
82
|
+
return {
|
|
83
|
+
parse(value) {
|
|
84
|
+
try {
|
|
85
|
+
return schema.parse(value);
|
|
86
|
+
} catch {
|
|
87
|
+
return fallbackValue;
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
safeParse(value) {
|
|
91
|
+
try {
|
|
92
|
+
return { success: !0, data: schema.parse(value) };
|
|
93
|
+
} catch {
|
|
94
|
+
return { success: !0, data: fallbackValue };
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=validateSearch.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/validateSearch.ts"],
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAyEO,MAAM,8BAA8B,MAAM;AAAA,EACtC,aAAa;AAAA,EACb;AAAA,EAET,YAAY,SAAiB,SAAoB,CAAC,GAAG;AACnD,UAAM,OAAO,GACb,KAAK,OAAO,yBACZ,KAAK,SAAS;AAAA,EAChB;AACF;AAKA,SAAS,iBAAiB,OAAyC;AACjE,SACE,OAAO,SAAU,YACjB,UAAU,QACV,eAAe,SACf,OAAQ,MAAc,WAAW,GAAG,YAAa;AAErD;AAKA,SAAS,gBAAgB,OAAwC;AAC/D,SACE,OAAO,SAAU,YACjB,UAAU,QACV,OAAQ,MAAc,SAAU;AAEpC;AAKA,SAAS,cAAc,OAA8D;AACnF,SAAO,OAAO,SAAU;AAC1B;AAKO,SAAS,kBAAkB,QAAmD;AACnF,QAAM,SAA4C,CAAC;AAGnD,SAFqB,IAAI,gBAAgB,MAAM,EAElC,QAAQ,CAAC,OAAO,QAAQ;AACnC,UAAM,WAAW,OAAO,GAAG;AAC3B,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O,EAAE,SAAS,IAAe,MAAM,cAAc;AAAA,MACvD;AAAA,IACF;AAAA,EACF;AACF;",
|
|
5
|
+
"names": []
|
|
6
|
+
}
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: !0
|
|
11
|
+
});
|
|
12
|
+
},
|
|
13
|
+
__copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
15
|
+
get: () => from[key],
|
|
16
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
+
});
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
21
|
+
value: !0
|
|
22
|
+
}), mod);
|
|
23
|
+
var validateSearch_exports = {};
|
|
24
|
+
__export(validateSearch_exports, {
|
|
25
|
+
SearchValidationError: () => SearchValidationError,
|
|
26
|
+
parseSearchString: () => parseSearchString,
|
|
27
|
+
validateSearch: () => validateSearch,
|
|
28
|
+
withFallback: () => withFallback,
|
|
29
|
+
zodSearchValidator: () => zodSearchValidator
|
|
30
|
+
});
|
|
31
|
+
module.exports = __toCommonJS(validateSearch_exports);
|
|
32
|
+
function _assert_this_initialized(self) {
|
|
33
|
+
if (self === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
34
|
+
return self;
|
|
35
|
+
}
|
|
36
|
+
function _call_super(_this, derived, args) {
|
|
37
|
+
return derived = _get_prototype_of(derived), _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
|
|
38
|
+
}
|
|
39
|
+
function _class_call_check(instance, Constructor) {
|
|
40
|
+
if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
|
|
41
|
+
}
|
|
42
|
+
function _construct(Parent, args, Class) {
|
|
43
|
+
return _is_native_reflect_construct() ? _construct = Reflect.construct : _construct = function (Parent2, args2, Class2) {
|
|
44
|
+
var a = [null];
|
|
45
|
+
a.push.apply(a, args2);
|
|
46
|
+
var Constructor = Function.bind.apply(Parent2, a),
|
|
47
|
+
instance = new Constructor();
|
|
48
|
+
return Class2 && _set_prototype_of(instance, Class2.prototype), instance;
|
|
49
|
+
}, _construct.apply(null, arguments);
|
|
50
|
+
}
|
|
51
|
+
function _define_property(obj, key, value) {
|
|
52
|
+
return key in obj ? Object.defineProperty(obj, key, {
|
|
53
|
+
value,
|
|
54
|
+
enumerable: !0,
|
|
55
|
+
configurable: !0,
|
|
56
|
+
writable: !0
|
|
57
|
+
}) : obj[key] = value, obj;
|
|
58
|
+
}
|
|
59
|
+
function _get_prototype_of(o) {
|
|
60
|
+
return _get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function (o2) {
|
|
61
|
+
return o2.__proto__ || Object.getPrototypeOf(o2);
|
|
62
|
+
}, _get_prototype_of(o);
|
|
63
|
+
}
|
|
64
|
+
function _inherits(subClass, superClass) {
|
|
65
|
+
if (typeof superClass != "function" && superClass !== null) throw new TypeError("Super expression must either be null or a function");
|
|
66
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
67
|
+
constructor: {
|
|
68
|
+
value: subClass,
|
|
69
|
+
writable: !0,
|
|
70
|
+
configurable: !0
|
|
71
|
+
}
|
|
72
|
+
}), superClass && _set_prototype_of(subClass, superClass);
|
|
73
|
+
}
|
|
74
|
+
function _is_native_function(fn) {
|
|
75
|
+
return Function.toString.call(fn).indexOf("[native code]") !== -1;
|
|
76
|
+
}
|
|
77
|
+
function _possible_constructor_return(self, call) {
|
|
78
|
+
return call && (_type_of(call) === "object" || typeof call == "function") ? call : _assert_this_initialized(self);
|
|
79
|
+
}
|
|
80
|
+
function _set_prototype_of(o, p) {
|
|
81
|
+
return _set_prototype_of = Object.setPrototypeOf || function (o2, p2) {
|
|
82
|
+
return o2.__proto__ = p2, o2;
|
|
83
|
+
}, _set_prototype_of(o, p);
|
|
84
|
+
}
|
|
85
|
+
function _type_of(obj) {
|
|
86
|
+
"@swc/helpers - typeof";
|
|
87
|
+
|
|
88
|
+
return obj && typeof Symbol < "u" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
89
|
+
}
|
|
90
|
+
function _wrap_native_super(Class) {
|
|
91
|
+
var _cache = typeof Map == "function" ? /* @__PURE__ */new Map() : void 0;
|
|
92
|
+
return _wrap_native_super = function (Class2) {
|
|
93
|
+
if (Class2 === null || !_is_native_function(Class2)) return Class2;
|
|
94
|
+
if (typeof Class2 != "function") throw new TypeError("Super expression must either be null or a function");
|
|
95
|
+
if (typeof _cache < "u") {
|
|
96
|
+
if (_cache.has(Class2)) return _cache.get(Class2);
|
|
97
|
+
_cache.set(Class2, Wrapper);
|
|
98
|
+
}
|
|
99
|
+
function Wrapper() {
|
|
100
|
+
return _construct(Class2, arguments, _get_prototype_of(this).constructor);
|
|
101
|
+
}
|
|
102
|
+
return Wrapper.prototype = Object.create(Class2.prototype, {
|
|
103
|
+
constructor: {
|
|
104
|
+
value: Wrapper,
|
|
105
|
+
enumerable: !1,
|
|
106
|
+
writable: !0,
|
|
107
|
+
configurable: !0
|
|
108
|
+
}
|
|
109
|
+
}), _set_prototype_of(Wrapper, Class2);
|
|
110
|
+
}, _wrap_native_super(Class);
|
|
111
|
+
}
|
|
112
|
+
function _is_native_reflect_construct() {
|
|
113
|
+
try {
|
|
114
|
+
var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
115
|
+
} catch {}
|
|
116
|
+
return (_is_native_reflect_construct = function () {
|
|
117
|
+
return !!result;
|
|
118
|
+
})();
|
|
119
|
+
}
|
|
120
|
+
var SearchValidationError = /* @__PURE__ */function (Error1) {
|
|
121
|
+
"use strict";
|
|
122
|
+
|
|
123
|
+
_inherits(SearchValidationError2, Error1);
|
|
124
|
+
function SearchValidationError2(message) {
|
|
125
|
+
var issues = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
|
|
126
|
+
_class_call_check(this, SearchValidationError2);
|
|
127
|
+
var _this;
|
|
128
|
+
return _this = _call_super(this, SearchValidationError2, [message]), _define_property(_this, "routerCode", "VALIDATE_SEARCH"), _define_property(_this, "issues", void 0), _this.name = "SearchValidationError", _this.issues = issues, _this;
|
|
129
|
+
}
|
|
130
|
+
return SearchValidationError2;
|
|
131
|
+
}(_wrap_native_super(Error));
|
|
132
|
+
function isStandardSchema(value) {
|
|
133
|
+
var _value_standard;
|
|
134
|
+
return (typeof value > "u" ? "undefined" : _type_of(value)) === "object" && value !== null && "~standard" in value && typeof ((_value_standard = value["~standard"]) === null || _value_standard === void 0 ? void 0 : _value_standard.validate) == "function";
|
|
135
|
+
}
|
|
136
|
+
function isZodLikeSchema(value) {
|
|
137
|
+
return (typeof value > "u" ? "undefined" : _type_of(value)) === "object" && value !== null && typeof value.parse == "function";
|
|
138
|
+
}
|
|
139
|
+
function isValidatorFn(value) {
|
|
140
|
+
return typeof value == "function";
|
|
141
|
+
}
|
|
142
|
+
function parseSearchString(search) {
|
|
143
|
+
var params = {},
|
|
144
|
+
searchParams = new URLSearchParams(search);
|
|
145
|
+
return searchParams.forEach(function (value, key) {
|
|
146
|
+
var existing = params[key];
|
|
147
|
+
existing === void 0 ? params[key] = value : Array.isArray(existing) ? existing.push(value) : params[key] = [existing, value];
|
|
148
|
+
}), params;
|
|
149
|
+
}
|
|
150
|
+
function validateSearch(validator, input) {
|
|
151
|
+
if (isStandardSchema(validator)) {
|
|
152
|
+
var result = validator["~standard"].validate(input);
|
|
153
|
+
if (result.issues) throw new SearchValidationError("Search param validation failed", result.issues);
|
|
154
|
+
return result.value;
|
|
155
|
+
}
|
|
156
|
+
if (isZodLikeSchema(validator)) {
|
|
157
|
+
if (validator.safeParse) {
|
|
158
|
+
var result1 = validator.safeParse(input);
|
|
159
|
+
if (!result1.success) throw new SearchValidationError("Search param validation failed", [result1.error]);
|
|
160
|
+
return result1.data;
|
|
161
|
+
}
|
|
162
|
+
try {
|
|
163
|
+
return validator.parse(input);
|
|
164
|
+
} catch (error) {
|
|
165
|
+
throw new SearchValidationError("Search param validation failed", [error]);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
if (isValidatorFn(validator)) try {
|
|
169
|
+
return validator(input);
|
|
170
|
+
} catch (error) {
|
|
171
|
+
throw new SearchValidationError("Search param validation failed", [error]);
|
|
172
|
+
}
|
|
173
|
+
throw new Error("Invalid validator provided to validateSearch");
|
|
174
|
+
}
|
|
175
|
+
function zodSearchValidator(schema) {
|
|
176
|
+
return schema;
|
|
177
|
+
}
|
|
178
|
+
function withFallback(schema, fallbackValue) {
|
|
179
|
+
return {
|
|
180
|
+
parse(value) {
|
|
181
|
+
try {
|
|
182
|
+
return schema.parse(value);
|
|
183
|
+
} catch {
|
|
184
|
+
return fallbackValue;
|
|
185
|
+
}
|
|
186
|
+
},
|
|
187
|
+
safeParse(value) {
|
|
188
|
+
try {
|
|
189
|
+
return {
|
|
190
|
+
success: !0,
|
|
191
|
+
data: schema.parse(value)
|
|
192
|
+
};
|
|
193
|
+
} catch {
|
|
194
|
+
return {
|
|
195
|
+
success: !0,
|
|
196
|
+
data: fallbackValue
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
//# sourceMappingURL=validateSearch.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","validateSearch_exports","__export","SearchValidationError","parseSearchString","validateSearch","withFallback","zodSearchValidator","module","exports","_assert_this_initialized","self","ReferenceError","_call_super","_this","derived","args","_get_prototype_of","_possible_constructor_return","_is_native_reflect_construct","Reflect","construct","constructor","apply","_class_call_check","instance","Constructor","TypeError","_construct","Parent","Class","Parent2","args2","Class2","a","push","Function","bind","_set_prototype_of","prototype","arguments","_define_property","obj","key","Object","defineProperty","enumerable","configurable","writable","o","setPrototypeOf","getPrototypeOf","o2","__proto__","_inherits","subClass","superClass","create","_is_native_function","fn","toString","call","indexOf","_type_of","p","p2","Symbol","_wrap_native_super","_cache","Map","has","get","set","Wrapper"],"sources":["../../src/validateSearch.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,sBAAA;AAAAC,QAAA,CAAAD,sBAAA;EAAAE,qBAAA,EAAAA,CAAA,KAAAA,qBAAA;EAAAC,iBAAA,EAAAA,CAAA,KAAAA,iBAAA;EAAAC,cAAA,EAAAA,CAAA,KAAAA,cAAA;EAAAC,YAAA,EAAAA,CAAA,KAAAA,YAAA;EAAAC,kBAAA,EAAAA,CAAA,KAAAA;AAAA;AAyEOC,MAAM,CAAAC,OAAA,GAAAb,YAAA,CAAAK,sBAAoC;AAAA,SACtCS,wBAAaA,CAAAC,IAAA;EACb,IAAAA,IAAA,aAET,UAAYC,cAAiB,4DAAwB;EACnD,OAAAD,IAAM;AAEQ;AAElB,SAAAE,YAAAC,KAAA,EAAAC,OAAA,EAAAC,IAAA;EAKA,OAASD,OAAA,GAAAE,iBAA0D,CAAAF,OAAA,GAAAG,4BAAA,CAAAJ,KAAA,EAAAK,4BAAA,KAAAC,OAAA,CAAAC,SAAA,CAAAN,OAAA,EAAAC,IAAA,QAAAC,iBAAA,CAAAH,KAAA,EAAAQ,WAAA,IAAAP,OAAA,CAAAQ,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B,IAAAA,MAAQ,CAAAE,GAAA,CAAArC,MAAA,UAAAmC,MAAA,CAAAG,GAAA,CAAAtC,MAAA;MACNmC,MAAA,CAAAI,GAAO,CAAEvC,MAAA,EAAAwC,OAAwB;IAAoB;IAEzD,SAAAA,QAAA;MACF,OAAA7C,UAAA,CAAAK,MAAA,EAAAO,SAAA,EAAAvB,iBAAA,OAAAK,WAAA;IACF","ignoreList":[]}
|
|
@@ -83,8 +83,8 @@ var buildVercelOutputDirectory = async function (param) {
|
|
|
83
83
|
routeToBuildInfo
|
|
84
84
|
} = buildInfoForWriting;
|
|
85
85
|
if (apiOutput) {
|
|
86
|
-
var
|
|
87
|
-
compiltedApiRoutes = ((
|
|
86
|
+
var _ref,
|
|
87
|
+
compiltedApiRoutes = ((_ref = apiOutput?.output) !== null && _ref !== void 0 ? _ref : []).filter(function (o) {
|
|
88
88
|
return (0, import_ts_pattern.isMatching)({
|
|
89
89
|
code: import_ts_pattern.P.string,
|
|
90
90
|
facadeModuleId: import_ts_pattern.P.string
|