0.0.23 • Published 5 years ago
@proem/union v0.0.23
@proem/union
@proem/union
provides functions for processing union types
Usage
import union from '@proem/union'
type Label = 'a' | 'b'
const label: Label = 'a'
function labelToNumber(label: Label) {
return union.mapLiteral(label, {
a: () => 1,
b: () => 2,
})
}