the great typeinfo unfuckening
This commit is contained in:
parent
db63f5639f
commit
49fed51ced
15 changed files with 233 additions and 365 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue