ForbesLindesay / funtypes

Runtime validation for static types
MIT License
29 stars 4 forks source link

feat: support arbitrary length unions #4

Closed ForbesLindesay closed 4 years ago

ForbesLindesay commented 4 years ago

I had to separate out "RuntypeBase" which only includes the actual validation methods from "Runtype" which includes all the helper methods. This is because internally we frequently treat Runtype as "covariant" i.e. if I was expecting a Runtype<string> it's ok to give me a Runtype<'hello world'>. TypeScript historically hasn't cared that much about variance, but over time it is getting strickter and the helper methods are often invariant.

BREAKING CHANGE: the various Union2, Union3, ... types have all been replaced with a single Union type that takes a tuple of Runtype validators.

rollingversions[bot] commented 4 years ago

Change Log for funtypes (1.0.0 → 2.0.0)

Breaking Changes

Edit changelog