UNPKG

one

Version:

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

31 lines (30 loc) 1.13 kB
import { getPathDataFromState } from "../fork/getPathFromState.native.js"; import { stripBaseUrl } from "../fork/getStateFromPath-mods.native.js"; import { getNormalizedStatePath } from "./getNormalizedStatePath.native.js"; import { isIndexPath } from "./isIndexPath.native.js"; import { getLinking } from "./linkingConfig.native.js"; function getRouteInfo(state) { return getRouteInfoFromState(function (state2, asPath) { var _getLinking; return getPathDataFromState(state2, { screens: [], ...((_getLinking = getLinking()) === null || _getLinking === void 0 ? void 0 : _getLinking.config), preserveDynamicRoutes: asPath, preserveGroups: asPath }); }, state); } function getRouteInfoFromState(getPathFromState, state, baseUrl) { var { 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.native.js.map