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.
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 aRuntype<'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 singleUnion
type that takes a tuple of Runtype validators.