Helper type to serialize object types while preserving required and optional properties. Separates defined properties from undefined/optional ones to maintain correct optionality in the resulting serialized type.
The object type to serialize
type User = { id: number; name: string; email?: string }type SerializedUser = SerializeJSONObject<User>// Result: { id: number; name: string } & { email?: string } Copy
type User = { id: number; name: string; email?: string }type SerializedUser = SerializeJSONObject<User>// Result: { id: number; name: string } & { email?: string }
Helper type to serialize object types while preserving required and optional properties. Separates defined properties from undefined/optional ones to maintain correct optionality in the resulting serialized type.