Files
Homarr/packages/common/src/object.ts
Thomas Camlong f1b1ec59ec chore: update prettier configuration for print width (#519)
* feat: update prettier configuration for print width

* chore: apply code formatting to entire repository

* fix: remove build files

* fix: format issue

---------

Co-authored-by: Meier Lukas <meierschlumpf@gmail.com>
2024-05-19 22:38:39 +02:00

10 lines
271 B
TypeScript

export function objectKeys<O extends object>(obj: O): (keyof O)[] {
return Object.keys(obj) as (keyof O)[];
}
type Entries<T> = {
[K in keyof T]: [K, T[K]];
}[keyof T][];
export const objectEntries = <T extends object>(obj: T) => Object.entries(obj) as Entries<T>;