trying to validate and decode api response:
const Foo = t.type({
id: t.number,
date: DateFromISOString,
});
type FooType = t.TypeOf<typeof Foo>;
const jsonFoo: FooType = {"id": 1, date: "2021-02-05T11:13:22.520Z"};
const resultFoo = Foo.decode(jsonFoo);
the problem is that type describes data property as a date while it's string in jsonFoo
Do I miss something there or I need 2 types for both incoming data and decoded object?