added a function that gets strictly typed keys of an object

This commit is contained in:
Miodec 2023-07-18 15:51:45 +02:00
parent 4111f5df8c
commit e2d021bbab

View file

@ -1605,3 +1605,12 @@ export function convertToMorse(word: string): string {
}
return morseWord;
}
declare global {
interface ObjectConstructor {
typedKeys<T>(obj: T): T extends T ? (keyof T)[] : never;
}
}
//@ts-ignore
Object.typedKeys = Object.keys;