Created
May 10, 2016 06:35
-
-
Save simongong/26bbddd5f5d0d1fbe0d163f20c55d697 to your computer and use it in GitHub Desktop.
Add display name for functions in a commonJS module
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
for(var func in module.exports) { | |
if (typeof module.exports[func] === 'function') { | |
module.exports[func].displayName = func; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment