#.
10 messages · Page 1 of 1 (latest)
doesn't seem like your Strict type does anything
it will always spit out the same type it recieved
i think they want it to error because "ERR_aaa" is not assignable to Uppercase<string>
i don't know zod very well but i think if anything this would be the way to do that:
Preview:```ts
import {z} from "zod"
z.object<Record<Uppercase<string>, string>>({
ERR_aaa: z.string(),
})```
however as you can see it doesn't work, because zod apparently constrains raw types to be keyed by string (using this type as the constraint: https://github.com/colinhacks/zod/blob/cfbc7b3f6714ced250dd4053822faf472bf1828e/src/types.ts#L48)
export type ZodRawShape = { [k: string]: ZodTypeAny };
i guess i really don't know zod very well. i'm not sure if this is exactly what you want, but it does work and maybe helps put you on the right path:
Preview:```ts
import {z} from "zod"
z.object<Record<Uppercase<string>, z.ZodTypeAny>>({
ERR_aaa: z.string(),
})```