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

13 lines
382 B
TypeScript

import type { z } from "zod";
import type { zodFieldView, zodField, zodRouterField, zodRouterFieldView } from "../zod";
export default function isRouterLinkedField(
field: z.infer<typeof zodFieldView> | z.infer<typeof zodField>
): field is z.infer<typeof zodRouterField> | z.infer<typeof zodRouterFieldView> {
if ("routerId" in field) {
return true;
}
return false;
}