Skip to content

Instantly share code, notes, and snippets.

@Kukks
Created June 28, 2016 15:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kukks/b0dd24f6659ad8d797afc3fb734e5d86 to your computer and use it in GitHub Desktop.
Save Kukks/b0dd24f6659ad8d797afc3fb734e5d86 to your computer and use it in GitHub Desktop.
export class Reflection {
public static getPropertyName( propertyFunction: Function ): string {
return /\.([^\.;]+);?\s*\}$/.exec(propertyFunction.toString())[1];
}
public static getPropertiesOfObject( object: any ): string[] {
let result: string[] = [];
if ( typeof object === "object" ) {
for ( let i in object ) {
result.push(i);
}
}
return result;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment