cal.pub0.org/packages/app-store/ee/routing-forms/lib/isRouter.ts

13 lines
381 B
TypeScript
Raw Normal View History

import type { z } from "zod";
import type { zodRouterRouteView, zodRoute, zodRouterRoute, zodRouteView } from "../zod";
export default function isRouter(
route: z.infer<typeof zodRouteView> | z.infer<typeof zodRoute>
): route is z.infer<typeof zodRouterRouteView> | z.infer<typeof zodRouterRoute> {
if ("isRouter" in route) {
return route.isRouter;
}
return false;
}