mirror of
https://git.um-react.app/um/um-react.git
synced 2025-11-28 11:33:02 +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]];
|
|
}
|
|
}
|
|
}
|