Uh, setting `noUncheckedIndexedAccess` in TSConfig gives you this behavior, no?
Uh, setting
noUncheckedIndexedAccess in TSConfig gives you this behavior, no?noUncheckedIndexedAccessz.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.inputProperty 'input' does not exist on typetransform.transform(value => ...)z.enum(countries)as const.partialcategoryschema.partial().parse()deepPartialsettingsSchemaTwofoobar: settingsSchemaOne.shape.foobar.exclude(['yes'])z.unionz.literalz
.string()
// add min/max/etc. here
.refine((str) => !/\W/.test(str), { message: 'Please only use alphanumeric characters and underscores (_)'})