WIP
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
export class EnumUtils {
|
||||
|
||||
public static hasFlag(obj: number, enumValue: number): boolean {
|
||||
if (obj) {
|
||||
if (obj & enumValue) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static GetAllEnumValue(enumType: any): number[] {
|
||||
return Object
|
||||
.keys(enumType)
|
||||
.filter((v) => !isNaN(Number(v)))
|
||||
.map(v => Number.parseInt(v));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user