Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
newMap.forEach((oldStart, oldEnd, newStart, newEnd) => {
console.log(om_oldStart, om_oldEnd, om_newStart, om_newEnd);
console.log(oldStart, oldEnd, newStart, newEnd);
// const offsetStart = Math.max(0, om_newStart - newStart);
// const offsetEnd = Math.max(0, om_newEnd - newEnd);
const offsetStart =
om_newStart > newStart && om_newStart < newEnd ? newEnd - om_newStart : 0;
const offsetEnd =
om_newEnd > newStart && om_newEnd < newEnd ? newEnd - om_newEnd : 0;
// Math.max(0, newStart - om_newStart);
// const offsetEnd = Math.max(0, newEnd - om_newEnd);
const offset = offsetStart - offsetEnd;
const thisNewStepMap = new StepMap([
om_newStart,
om_oldEnd - om_oldStart,
om_newEnd - om_newStart - offset,
]);
newestMapping.appendMap(thisNewStepMap);
});
});
additionalSteps.map((as) => {
if (as.slice) {
const size = as.slice.size;
return new StepMap(as.from - size, 0, as.size);
}
return as.getMap();
}),
);