Skip to main content

DeepPartial

객체의 모든 속성을 옵셔널하게 만듭니다

Signature

type DeepPartial<T extends Obj | undefined> = Partial<{ [K in keyof T]: T[K] extends Obj | undefined ? Partial<T[K]> : T[K] }>;

References

Obj

Example

type Example = DeepPartial<{
a: number;
b: { c : number; d : string };
}>;

Example = {
a?: number;
b?: { c? : number; d? : string };
}

tsx