Typescript says object is possibly 'undefined' for an object property, even after checking/narrowing if the property exists.

This page summarizes the projects mentioned and recommended in the original post on /r/typescript

Our great sponsors
  • SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • proposal-record-tuple

    ECMAScript proposal for the Record and Tuple value types. | Stage 2: it will change!

  • Thank you for the article, I will give it a read tomorrow as it's getting quite late. And is by any chance this the proposal you're talking about?

  • TypeScript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • Yep! Having these record and tuple types could help with some of those "weird TS things", like how Object.keys returns string[] rather than a union of the object's keys. I don't know exactly what the corresponding TS features would be, but I imagine that having immutable primitives could allow for better type inference in some cases and fewer edge cases.

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

    SurveyJS logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts