@proem/union
v0.0.23
Published
proem package for handling union types
Downloads
1
Readme
@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,
})
}