Created
April 28, 2011 17:45
-
-
Save Kami/946847 to your computer and use it in GitHub Desktop.
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 stringifyCoverage(_jscoverage) { | |
| var i, file, fileObj, fileLines; | |
| var coverageObj = {}; | |
| files = Object.keys(_jscoverage); | |
| for (i = 0; i < files.length; i++) { | |
| file = files[i]; | |
| fileObj = _jscoverage[file]; | |
| source = fileObj['source']; | |
| delete fileObj['source']; | |
| fileLines = Object.keys(fileObj); | |
| coverageObj[file] = { | |
| 'lines': fileLines, | |
| 'source': source | |
| }; | |
| } | |
| return JSON.stringify(coverageObj); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment