- mapEnumToObject<const Enum extends EnumBaseType, const Value>(
enumInput: Enum,
callback: (enumValue: Values<Enum>) => Promise<Value>,
): Promise<EnumMap<Enum, Value>> - mapEnumToObject<const Enum extends EnumBaseType, const Value>(
enumInput: Enum,
callback: (enumValue: Values<Enum>, wholeEnum: Enum) => Value,
): Value extends Promise<any>
? Promise<any> extends Value
? Promise<EnumMap<Enum, Awaited<Value>>>
: MaybePromise<EnumMap<Enum, Awaited<Value>>>
: EnumMap<Enum, Value>
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