sajad torkamani

Before:

Object.keys(yourObj) // returns string[] even if you provided a type definition for yourObj

After:

Run npm i ts-extras and then use like this:

import { objectKeys } from 'ts-extras'

objectKeys(yourObject) // returns ProperTypeOfYourObj[]

Tagged: TypeScript

Leave a comment

Your email address will not be published. Required fields are marked *