Runtime type checking with io-ts in Typescript