Last active
April 19, 2019 19:11
-
-
Save DDzia/faee701bdd255593ebd1150a4be03434 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class EnumHelpers { | |
/** | |
* No instances guard. | |
*/ | |
private constructor() { } | |
/** | |
* Get all keys from enumeration. | |
*/ | |
public static keys(enumType: object) { | |
const members = Object.keys(enumType); | |
return members.filter(x => Number.isNaN(parseInt(x, 10)) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment