mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-20 04:26:28 +08:00
added a function that gets strictly typed keys of an object
This commit is contained in:
parent
4111f5df8c
commit
e2d021bbab
1 changed files with 9 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue