Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public getCoverage(): { stateNodes: Record } {
const stateNodes = getStateNodes(this.machine);
const coverage = {
stateNodes: stateNodes.reduce((acc, stateNode) => {
acc[stateNode.id] = 0;
return acc;
}, {})
};
for (const key of this.coverage.stateNodes.keys()) {
coverage.stateNodes[key] = this.coverage.stateNodes.get(key);
}
return coverage;
}