UNPKG

alwaysai

Version:

The alwaysAI command-line interface (CLI)

10 lines (9 loc) 270 B
export function keyMirror<T extends object>(obj: T): { [K in keyof T]: K } { const newObj = {}; for (const key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[String(key)] = key; } } return newObj as { [K in keyof T]: K }; }