20 lines
No EOL
542 B
TypeScript
20 lines
No EOL
542 B
TypeScript
|
|
import { type ClassValue, clsx } from "clsx"
|
|
import { twMerge } from "tailwind-merge"
|
|
|
|
export function cn(...inputs: ClassValue[]) {
|
|
return twMerge(clsx(inputs));
|
|
}
|
|
|
|
export function getHosts(route: Route) {
|
|
return route.match.map(match => match.host).flatMap(host => host);
|
|
}
|
|
|
|
export function getRouteType(route: Route) {
|
|
return route.handle[0].handler;
|
|
}
|
|
|
|
export function getRouteUpstreams(route: Route, index: number = 0) {
|
|
let test: Upstream[] = route.handle[index].routes?.flat()[index].handle[index].upstreams!;
|
|
return test;
|
|
} |