Maps all values of an enum as keys in an object where each value is the callback's output for that key.
import {mapEnumToObject} from '@augment-vir/common';enum MyEnum { A = 'a', B = 'b',}mapEnumToObject(MyEnum, (enumValue) => { return `value-${enumValue}`;});// output is `{[MyEnum.A]: 'value-a', [MyEnum.B]: 'value-b'}` Copy
import {mapEnumToObject} from '@augment-vir/common';enum MyEnum { A = 'a', B = 'b',}mapEnumToObject(MyEnum, (enumValue) => { return `value-${enumValue}`;});// output is `{[MyEnum.A]: 'value-a', [MyEnum.B]: 'value-b'}`
@augment-vir/common
Maps all values of an enum as keys in an object where each value is the callback's output for that key.
Example
Package
@augment-vir/common