Skip to main content

Panagiotis Vekris
Historical

This post announced user-defined type guards when it was introduced. For current syntax and behavior, see the Type Guards documentation.

Flow now lets you define a function that encodes a type predicate over its parameter.