mirror of
https://github.com/lux-tel/session-desktop.git
synced 2026-10-30 20:33:24 +00:00
8 lines
263 B
TypeScript
8 lines
263 B
TypeScript
/**
|
|
* Object.entries() but in a type-safe way.
|
|
* @param obj The object to get the entries from.
|
|
*/
|
|
export const objectEntries = <T extends { [K in keyof T]: T[K] }>(obj: T) => {
|
|
return Object.entries(obj) as Array<{ [K in keyof T]: [K, T[K]] }[keyof T]>;
|
|
};
|