Copy

TypeScript Weekly

Issue #124 — February 5, 2020

TypeScript’s Quirks

A few TypeScript features that work in a potentially surprising way: interfaces with excess properties, nominal typing with classes, and discriminated unions.

Alex Cole

Adding Special Values to Types in TypeScript

How to represent sentinel values in the type system using special values, symbols, literal types, or discriminated unions.

Dr. Axel Rauschmayer

Type Compatibility: Objects and Functions

How TypeScript’s structural type system determines assignability of object and function types.

John Au-Yeung

Check for Object Properties and Narrow Down Type

A useful hasOwnProperty function built using type predicates, intersection types, and the Record<K, T> type.

Stefan Baumgartner