-
-
Save monkpit/65c632c1f9d8725edbd8be3d170bed79 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