A new object type with primitive types.
type Actual = {
a: 'a';
b: 85;
c: true;
d: {
e: 'xxxxxxxxxxx';
f: 'eeeeeeeeeeeeeeeeee';
g: {
h: 1000000000000000;
i: undefined;
j: null;
};
};
};
type Expected = {
a: string;
b: number;
c: boolean;
d: {
e: string;
f: string;
g: {
h: number;
i: undefined;
j: null;
};
};
};
type Result = DeepToPrimitive<Actual>; // Result: Expected
Recursively transforms an object type T into a type where all properties are replaced with their corresponding primitive types.