Susan Potter

TypeScript :: JavaScript with type expressive superpowers!

software

TypeScript's Mapped Types

In this in-depth exploration we discover the power of mapped types in TypeScript through numerous examples. At the end working through the article you will be able to transform properties with ease, and master best practices when adopting mapped types.

software

Cross-runtime TypeScript Library Development: A Deno-Node Workflow

Are you a TypeScript developer who loves Deno’s safe and sandboxed environment and its out-of-the-box TypeScript, LSP, linting, formatting, stdlib testing and benchmarking support? Join me as I walk you through a possible workflow that combines the best of Deno tooling with Node.js compatibility.

software

Using Conditional Types in TypeScript

Dive into TypeScript's conditional types and discover how they empower developers to create flexible type mappings and enhance type safety. This article explores the mechanics of conditional types, demonstrates their application through practical examples, and showcases their ability to eliminate runtime bugs and improve code resilience. Embrace the power of TypeScript's conditional types and unleash the full potential of your code!

software

TypeScript's keyof operator and possible uses

Discover the incredible potential of the keyof operator in TypeScript and revolutionize your code for a better development experience.

software

TypeScript enum, const enum and ambient enums

Discover the differences between TypeScript's enum and const enum, and how they impact generated JavaScript code. Learn how enum values are transformed and when code is generated. Unveil the limitations and benefits of using const enums. Let TypeScript guide you through this enlightening journey of enum-powered programming.

software

Algebraic Data Types in TypeScript

Note: the code for the TypeScript (to help you follow along) is available here: Encoding Algebraic Data Types in TypeScript code Background Recently I've been reviewing TypeScript code at work. A common pattern I've observed in pull requests and some open source projects is a type that looks like the following: type FooTag = 'Bar' | 'Baz' | 'Qux'; type Foo<A> = { _tag : FooTag, /* Required for the 'Bar' tagged values of Foo */ …