Created
November 22, 2017 06:01
-
-
Save williscool/39ad5473524fab34bbb4d43e7e9e8c11 to your computer and use it in GitHub Desktop.
Revisions
-
williscool created this gist
Nov 22, 2017 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ /** * Filters am emum to only return the keys represented in it * * How is this not built into the language? * https://stackoverflow.com/a/21294925/511710 * https://noahbass.com/posts/typescript-enum-iteration * * @param {{}} e * @returns */ function filterEnum(e: {}) { return Object.keys(e).filter(v => isNaN(Number(v))); }