Optionalize

Makes all of properties in T optional when they're null | undefined it is recursive

Signature

export type Optionalize<T> = T extends object ? T extends Array<unknown> ? number extends T['length'] ? T[number] extends object ? Array<OptionalizeAux<T[number]>> : T : Partial<T> : OptionalizeAux<T> : T;

Private types

OptionalizeAuxTypeAlias
type OptionalizeAux<T extends object> = Identify<{    [K in KeysWithUndefined<T>]?: T[K] extends ObjectLiteral ? Optionalize<T[K]> : T[K];} & {    [K in Exclude<keyof T, KeysWithUndefined<T>>]: T[K] extends ObjectLiteral ? Optionalize<T[K]> : T[K];}>;

Members

This export does not declare public properties or methods in the generated declaration file.