refactor: unify logic

This commit is contained in:
Carlos Valente
2024-08-27 08:57:20 +02:00
committed by Carlos Valente
parent 25c7915cf7
commit f5936e5254
8 changed files with 147 additions and 40 deletions
@@ -113,7 +113,6 @@ export function generate(
const timeFromPrevious: number = getTimeFromPrevious(
currentEntry.timeStart,
currentEntry.timeEnd,
lastEntry?.timeStart,
lastEntry?.timeEnd,
lastEntry?.duration,
@@ -157,13 +156,6 @@ export function generate(
totalDelay += currentEntry.duration;
}
// eslint-disable-next-line no-unused-labels -- dev code path
DEV: {
if (totalDuration < 0) {
throw new Error('rundownCache.generate: invalid data');
}
}
// add id to order
order.push(currentEntry.id);
// add entry to rundown