Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
};
}
/**
* SourceCoverage provides mutation methods to manipulate the structure of
* a file coverage object. Used by the instrumenter to create a full coverage
* object for a file incrementally.
*
* @private
* @param pathOrObj {String|Object} - see the argument for {@link FileCoverage}
* @extends FileCoverage
* @constructor
*/
class SourceCoverage extends _istanbulLibCoverage.classes.FileCoverage {
constructor(pathOrObj) {
super(pathOrObj);
this.meta = {
last: {
s: 0,
f: 0,
b: 0
}
};
}
newStatement(loc) {
const s = this.meta.last.s;
this.data.statementMap[s] = cloneLocation(loc);
this.data.s[s] = 0;
this.meta.last.s += 1;
/*
Copyright 2015, Yahoo Inc.
Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
*/
'use strict';
const { FileCoverage } = require('istanbul-lib-coverage').classes;
function locString(loc) {
return [
loc.start.line,
loc.start.column,
loc.end.line,
loc.end.column
].join(':');
}
class MappedCoverage extends FileCoverage {
constructor(pathOrObj) {
super(pathOrObj);
this.meta = {
last: {