Assuming we have
type FormValue = {
person: {
city?: string;
}
}
SetRequired do not allow creation of FormValuee with city set as required. I belive it can be done with template literal types,
eg
type DeepKeyOf<T> = (
[T] extends [never] ? "" :
T extends object ? (
{ [K in Exclude<keyof T, symbol>]:
`${K}${undefined extends T[K] ? "?" : ""}${DotPrefix<DeepKeyOf<T[K]>>}` }[
Exclude<keyof T, symbol>]
) : ""
) extends infer D ? Extract<D, string> : never;
type DotPrefix<T extends string> = T extends "" ? "" : `.${T}`;
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too