Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
(counts, actor: any) => {
const parentActorType = actor.opts.parentActor.type;
const count = counts[parentActorType] || 0;
if (actor.stage === AsyncStage.STARTED) {
return {
...counts,
[parentActorType]: count + 1,
};
}
if (count > 1) {
return {
...counts,
[parentActorType]: count - 1,
};
}
return omit(counts, parentActorType);
},
{} as Dictionary,