I am working with 2 enums:
enum Insurer {
PREMERA = 'premera_blue_cross',
UHC = 'united_health_care'
}
enum ProductSource {
PremeraBlueCross = 'premera_blue_cross',
UnitedHealthCare = 'united_health_care'
}
I attempted to check if an array of Insurers includes a Product Source:
const insurerArr: Insurer[] = [Insurer.PREMERA, Insurer.UHC]
insurerArr.includes(ProductSource.PremeraBlueCross)
However, I encountered an error from the TypeScript compiler:
Argument of type 'ProductSource' is not assignable to parameter of type 'Insurer'.
Is there a method to compare without needing to cast to string
and then to the other enum?