12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- export function cloneProcessCov(processCov) {
- const result = [];
- for (const scriptCov of processCov.result) {
- result.push(cloneScriptCov(scriptCov));
- }
- return {
- result,
- };
- }
- export function cloneScriptCov(scriptCov) {
- const functions = [];
- for (const functionCov of scriptCov.functions) {
- functions.push(cloneFunctionCov(functionCov));
- }
- return {
- scriptId: scriptCov.scriptId,
- url: scriptCov.url,
- functions,
- };
- }
- export function cloneFunctionCov(functionCov) {
- const ranges = [];
- for (const rangeCov of functionCov.ranges) {
- ranges.push(cloneRangeCov(rangeCov));
- }
- return {
- functionName: functionCov.functionName,
- ranges,
- isBlockCoverage: functionCov.isBlockCoverage,
- };
- }
- export function cloneRangeCov(rangeCov) {
- return {
- startOffset: rangeCov.startOffset,
- endOffset: rangeCov.endOffset,
- count: rangeCov.count,
- };
- }
|