For TypeScript there is the pure functional https://github.com/paperhive/fefe
Less boilerplate than the other solutions I know... for example it allows you to define types easily just by writing a parser/validator ("transformation" in fefe terminology).