Created
June 28, 2016 15:23
-
-
Save Kukks/b0dd24f6659ad8d797afc3fb734e5d86 to your computer and use it in GitHub Desktop.
This file contains 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
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