This project adheres to semantic versioning.
Fixes pattern matching branches which return undefined
in matchX
and matchXW
.
Adds supports for convenient "strict" pattern matching without access to member values, denoted by an "X" suffix.
Adds a first-class, low-level is
primitive for refining foreign data to a known sum member.
Fixes reference equality of deserialized nullary sums.
Fixes nullary equality checks in Jest and others that compare the reference equality of functions.
Exports the types Match
and MatchW
to workaround type errors that appear when compiling with the declaration
compiler option enabled.
Nullary constructors are no longer function calls, fixing an edge case unsafety. Where you previously called mk.Member()
, now simply refer to mk.Member
.
Add ESM support.
Fix runtime representation of nullary constructors.
Exhaustive checking in pattern matching now reports on missing members. Previously it would report on a missing wildcard.
The internal representation of nullary constructors has been changed to use null
instead of undefined
for easier JSON interop post-serialisation.
Expose the Serialized
type for easier usage of the serialization functions.
The initial release of @unsplash/sum-types
with support for non-generic sum types, pattern matching with or without wildcards, and (de)serialization.