Urgent.News

the world's headlines, one feed

Tech

satisfies replaced most of my type annotations, and all of my as

You have a config object. You want two things at once: TypeScript should check it against a type TypeScript should remember the exact values you wrote Before TS 4.9 you could have either one. Not both. Annotating loses the detail type Config = Record < string , string | number > const config : Config = { host : ' localhost ' , port : 3000 , } config . port . toFixed () // Error: Property…

We haven't written up this one. Dev.to has the full story — the link below goes straight to it.

Read the original at dev.to →

More in Tech