all files / lib/ remapBranch.js

93.33% Statements 14/15
83.33% Branches 5/6
100% Functions 1/1
93.33% Lines 14/15
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33    107× 107×   107× 157× 157× 57×     100× 50×   50×       100×     50×           50×      
"use strict";
 
function remapBranch(genItem, getMapping) {
  var locations = [];
  var source = void 0;
 
  for (var i = 0; i < genItem.locations.length; ++i) {
    var mapping = getMapping(genItem.locations[i]);
    if (!mapping) {
      return null;
    }
 
    if (!source) {
      source = mapping.source;
    } else {
      Iif (source !== mapping.source) {
        return null;
      }
    }
    locations.push(mapping.loc);
  }
 
  var srcItem = {
    line: locations[0].start.line,
    type: genItem.type,
    locations: locations
  };
 
  return { source: source, srcItem: srcItem };
}
 
module.exports = remapBranch;
//# sourceMappingURL=remapBranch.js.map