Skip to content

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 ParameterDescription
T extends objectobject 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;
//   };
// };