mirror of
https://git.unlock-music.dev/um/um-react.git
synced 2024-11-28 00:02:18 +00:00
8 lines
205 B
TypeScript
8 lines
205 B
TypeScript
|
export function* enumObject<T>(obj: Record<string, T> | null | void): Generator<[string, T]> {
|
||
|
if (obj && typeof obj === 'object') {
|
||
|
for (const key in obj) {
|
||
|
yield [key, obj[key]];
|
||
|
}
|
||
|
}
|
||
|
}
|