Skip to content

Instantly share code, notes, and snippets.

@DDzia
Created April 19, 2019 09:20
Show Gist options
  • Save DDzia/1df29347981d7239327f2030b9ac4966 to your computer and use it in GitHub Desktop.
Save DDzia/1df29347981d7239327f2030b9ac4966 to your computer and use it in GitHub Desktop.
/**
* Get key-value array from enumeration.
*/
public static toKeyValueArray(enumType: object) {
return EnumHelpers.keys(enumType).map(key => ({ key, value: enumType[key] }));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment