gillchristian/io-ts-reporters

Truncate long values

OliverJAsh opened this issue · 3 comments

We should truncate long values to avoid ridiculously long strings.

Unless the truncation is smart about what it clips I’d more prefer smarter decisions of what to display

For instance something like a union type of two complex interfaces failing up the chain because of a value really deep inside - if we can identify just the key and type of that leaf value instead and print out the path, it would avoid super long types and probably be sufficient to cut down most long errors

Cc @gillchristian if that’s something your PR can potentially do

Also potentially deduping and merging types with the same paths

In retrospect now I do think some truncation makes sense - sometimes if a value is just missing altogether then being smart about paths and what not doesn't really help.