DeepNormalizedObject<T>
ts
type DeepNormalizedObject<T> = { [K in keyof T]: DeepNormalized<T[K]> };Defined in: types.ts:127
Recursively applies DeepNormalized to all properties of an object type.
Type Parameters
| Type Parameter | Description |
|---|---|
T extends object | object type to normalize |
Example
ts
// Before:
type RawUser = {
id: string | number | null;
name?: string | null;
address: {
street: string | null;
city?: string | null;
} | null;
};
// Usage:
type NormalizedUser = DeepNormalizedObject<RawUser>;
// After (assuming `DeepNormalized<T>` removes null/undefined and recurses):
// type NormalizedUser = {
// id: string | number;
// name: string;
// address: {
// street: string;
// city: string;
// };
// };