Is there a way to reassign the value of an object using TypeScript?
I have an interface defined as follows:
interface Root {
userId: number;
id: number;
title: string;
completed: boolean;
}
I am familiar with creating a zod schema from this interface like so:
const zRoot: z.ZodType<Root> = z.object({
userId: z.number(),
id: z.number(),
title: z.string(),
completed: z.boolean(),
});
However, I am unsure how to create a schema that types like this:
type RootObjectArray = {
[F in keyof Root]: Root[F][];
};