const EnumHelper = {
    ParseToEnum(TEnum, value, comparison = '') {
        if (Object.isFrozen) {
            let t = Object.values(TEnum)
            let r = t.find(x => (comparison != '' && x[comparison] == value) || (comparison == '' && x == value))
            return r
        } else {
            throw new Error("这不是一个枚举类型");
        }
    }
}

export default EnumHelper