ObjectEntries
A TypeScript utility type that represents the entries of an object as a union of tuple types. Each tuple contains a key-value pair where the key and value types are precisely typed according to the input object type.
@example
type MyObject = { a: 1; b: 'B' }
type MyEntries = ObjectEntries<MyObject>
// ^ ["a", 1] | ["b", "B"]
type ObjectEntries<T extends Record<string, any>> = [K in keyof T]: [K, T[K]][keyof T];