Not sure if I'm understanding correctly, but what would stop you from typing the catchall as `z.numb
Not sure if I'm understanding correctly, but what would stop you from typing the catchall as
z.number().optional()noUncheckedIndexedAccess in TSConfig gives you this behavior, no?z.input? I get Property 'input' does not exist on type
transform out all the non-word characters, or course it's not gonna work.transform(value => ...) line from the schemaz.enum(countries) but you have to as const your array.partial does exactly what you need if I got it right? If you really don't want to store it as a separate schema you can just do categoryschema.partial().parse()deepPartial instead of just partialsettingsSchemaTwo, instead of explicitly defining the allowed values, you can also do something like foobar: settingsSchemaOne.shape.foobar.exclude(['yes'])z
.string()
// add min/max/etc. here
.refine((str) => !/\W/.test(str), { message: 'Please only use alphanumeric characters and underscores (_)'})z.unionz.literal