one
Version:
One is a new React Framework that makes Vite serve both native and web.
30 lines (29 loc) • 1 kB
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) => {
return getPathDataFromState(state2, {
screens: [],
...getLinking()?.config,
preserveDynamicRoutes: asPath,
preserveGroups: asPath
});
}, state);
}
function getRouteInfoFromState(getPathFromState, state, baseUrl) {
const {
path
} = getPathFromState(state, false);
const qualified = getPathFromState(state, true);
return {
unstable_globalHref: path,
pathname: stripBaseUrl(path, baseUrl).split("?")[0],
isIndex: isIndexPath(state),
...getNormalizedStatePath(qualified, baseUrl)
};
}
export { getRouteInfo };
//# sourceMappingURL=getRouteInfo.mjs.map