import { CoverageSummary } from './common'; // Typing this is so complex. Better to inline the code altogether. export const mapToObject = ( map: Map ): { [key: string]: T } => { let objMap: { [key: string]: T } = {}; map.forEach((v, k) => { objMap[k] = v; }); return objMap; }; export const objectToMap = (obj: { [key: string]: T; }): Map => new Map(Object.entries(obj)); export const getSummaryPercentages = (summary: CoverageSummary) => ({ lines: summary.lines.pct, statements: summary.statements.pct, functions: summary.functions.pct, branches: summary.branches.pct });