Advertisement
Guest User

Untitled

a guest
May 30th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. function shareEnum(enu:any):string[] {
  2. return Object.keys(enu)
  3. .filter((key:string) => {
  4. let value = parseInt(key);
  5. return typeof value === "number" && isFinite(value) && Math.floor(value) === value;
  6. })
  7. .reduce((result:string[], key:string) => {
  8. result[key] = enu[key];
  9. return result;
  10. }, []);
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement