one
Version:
One is a new React Framework that makes Vite serve both native and web.
28 lines (27 loc) • 968 B
JavaScript
import { getPathDataFromState } from "../fork/getPathFromState.mjs";
import { stripBaseUrl } from "../fork/getStateFromPath-mods.mjs";
import { getNormalizedStatePath } from "./getNormalizedStatePath.mjs";
import { isIndexPath } from "./isIndexPath.mjs";
import { getLinking } from "./linkingConfig.mjs";
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.mjs.map