an enum from the list
const Colors = toEnum(['red', 'green', 'blue'])
console.log(Colors.Red) // 'red'
console.log(Colors.Green) // 'green'
console.log(Colors.Blue) // 'blue'
const Colors = toEnum(['red', 'green', 'blue'], { CapitalizeKeys: true, CapitalizeValues: true })
console.log(Colors.Red) // 'Red'
console.log(Colors.Green) // 'Green'
console.log(Colors.Blue) // 'Blue'
Generated using TypeDoc
Converts a list of strings to an enum type.