Mastering Development

Is there an automatically javascript browser type checker that replaces unmatched type with default value?

While we have typescript to ensure (to an extend) that the project itself has cohesive types once we start requesting APIs to the backend we cannot ensure the types returned from the server would match the interface we defined in our apps. Is there a plugin where it takes typescript interface and check the data returned by the API and then allow us to replace all unmatched types with a default value (or throw an error)? If not do you think such plugin/SDK would be needed? (I could create one.)

Leave a Reply

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