Created
August 12, 2015 09:37
-
-
Save a-v-l/ef8e8216bff709a81fb8 to your computer and use it in GitHub Desktop.
Function to reveal the structure of an javascript web app
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 characters
| function revealApp(app, tab) { | |
| tab = tab || ""; | |
| Object.getOwnPropertyNames(app).forEach(function(key, idx, array) { | |
| var val = app[key], | |
| type = typeof(val), | |
| output = type !== "function" ? ( type !== "object" ? val : '' ) : 'function()'; | |
| console.log(tab + key + ' -> ' + output); | |
| if ( type === 'object' && val != null ) { | |
| showall(val, tab + " "); | |
| } | |
| }); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment