TypeScript

2 posts
TypeScript

A Good Way How to Validate Types in TypeScript

TL;DR: I've created a typescript library fp-ts-type-check. You can use it to validate the structure of data you get from outside of your application.

Here's the situation: your typescript application needs to retrieve some object via some API. You make an API request and you get a successful response with some json. Probably it's the data you expect but you can't say for sure. Your actions?

TypeScript

React Styleguidist Usage Examples in Typescript Files

React Styleguidist uses external Markdown files to store usage examples. We wanted to use TypeScript for examples because reasons and we managed to do this with horrible solution. It includes custom webpack loader that parses TypeScript file with regular expressions and converts it to markdown. You could find parts of our code below.