UNPKG

one

Version:

One is a new React Framework that makes Vite serve both native and web.

30 lines (29 loc) 957 B
import { getPathDataFromState } from "../fork/getPathFromState"; import { stripBaseUrl } from "../fork/getStateFromPath-mods"; import { getNormalizedStatePath } from "./getNormalizedStatePath"; import { isIndexPath } from "./isIndexPath"; import { getLinking } from "./linkingConfig"; function getRouteInfo(state) { return getRouteInfoFromState( (state2, asPath) => getPathDataFromState(state2, { screens: [], ...getLinking()?.config, preserveDynamicRoutes: asPath, preserveGroups: asPath }), state ); } function getRouteInfoFromState(getPathFromState, state, baseUrl) { const { path } = getPathFromState(state, !1), qualified = getPathFromState(state, !0); return { unstable_globalHref: path, pathname: stripBaseUrl(path, baseUrl).split("?")[0], isIndex: isIndexPath(state), ...getNormalizedStatePath(qualified, baseUrl) }; } export { getRouteInfo }; //# sourceMappingURL=getRouteInfo.js.map