unsplash / sum-types-io-ts

io-ts bindings for @unsplash/sum-types.
https://unsplash.github.io/sum-types-io-ts/
MIT License
2 stars 1 forks source link

Widen stringly mapped constructor to all primitives #13

Closed samhh closed 1 year ago

samhh commented 1 year ago

Solves this internal use case: https://github.com/unsplash/unsplash-web/pull/9143#discussion_r1042133211

Currently the stringly mapped codec constructor - one of the most convenient - only supports matching against strings. This PR widens it to support any primitive type. This is as wide as we can go without requiring Eqs from the consumer.