lib/mocha.js
function map(cov) {
  var ret = {
      instrumentation: 'node-jscoverage'
    , sloc: 0
    , hits: 0
    , misses: 0
    , coverage: 0
    , files: []
  };

  for (var filename in cov) {
    var data = coverage(filename, cov[filename]);
    ret.files.push(data);
    ret.hits += data.hits;
    ret.misses += data.misses;
    ret.sloc += data.sloc;
  }

  ret.files.sort(function(a, b) {
    return a.filename.localeCompare(b.filename);
  });

  if (ret.sloc > 0) {
    ret.coverage = (ret.hits / ret.sloc) * 100;
  }

  return ret;
}
function map(cov) {
  var ret = {
      instrumentation: 'node-jscoverage'
    , sloc: 0
    , hits: 0
    , misses: 0
    , coverage: 0
    , files: []
  };

  for (var filename in cov) {
    var data = coverage(filename, cov[filename]);
    ret.files.push(data);
    ret.hits += data.hits;
    ret.misses += data.misses;
    ret.sloc += data.sloc;
  }

  ret.files.sort(function(a, b) {
    return a.filename.localeCompare(b.filename);
  });

  if (ret.sloc > 0) {
    ret.coverage = (ret.hits / ret.sloc) * 100;
  }

  return ret;
}
function map ( cov ) { var ret = { instrumentation : 'node-jscoverage' , sloc : 0 , hits : 0 , misses : 0 , coverage : 0 , files : [ ] } ; for ( var filename in cov ) { var data = coverage ( filename , cov [ filename ] ) ; ret . files . push ( data ) ; ret . hits += data . hits ; ret . misses += data . misses ; ret . sloc += data . sloc ; } ret . files . sort ( function ( a , b ) { return a . filename . localeCompare ( b . filename ) ; } ) ; if ( ret . sloc > 0 ) { ret . coverage = ( ret . hits / ret . sloc ) * 100 ; } return ret ; }
Map jscoverage data to a JSON structure
suitable for reporting.

@param {Object} cov
@return {Object}
@api private
Map jscoverage data to a JSON structure suitable for reporting .