Created
April 6, 2020 23:22
-
-
Save kpittman-securus/65ee1611580c1e848a9141b09e3b75a5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const keymap = <T extends unknown, U extends object>( | |
object: U, | |
callback: (key: keyof U, index: number) => T | |
) => (Object.keys(object) as (keyof U)[]).map(callback); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment