the great typeinfo unfuckening

This commit is contained in:
outfoxxed 2025-07-21 17:15:39 -07:00
parent db63f5639f
commit 49fed51ced
Signed by: outfoxxed
GPG key ID: 4C88A185FB89301E
15 changed files with 233 additions and 365 deletions

View file

@ -9,9 +9,8 @@ import {
import type {
ConfigHeading,
ConfigTOC,
GroupedRoutes,
} from "@components/navigation/sidebars/types";
import type { QMLTypeLinkObject, RouteData } from "./types";
import type { QMLTypeLinkObject } from "./types";
export function buildHierarchy(headings: ConfigHeading[]) {
const toc: ConfigTOC[] = [];
@ -43,23 +42,6 @@ export function buildHierarchy(headings: ConfigHeading[]) {
return toc;
}
export function groupRoutes(routes: RouteData[]): GroupedRoutes {
const froutes = routes.filter(route => route.name !== "index");
return froutes.reduce<GroupedRoutes>((acc, route) => {
if (!acc.types) acc.types = {};
if (!acc.types[route.type]) {
acc.types[route.type] = [];
}
acc.types[route.type].push({
name: route.name,
type: route.type,
});
return acc;
}, { types: {} });
}
export function getQMLTypeLinkObject(unparsed: string) {
const isLocal = unparsed.startsWith("MQS_") ? "local" : false;
const isQT = unparsed.startsWith("MQT_") ? "qt" : false;