Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
true
)
});
}
} else {
//new range passed
// return selectionLayerUpdate(newRange);
let selectionFullyContained = !trimRangeByAnotherRange(
selectionLayer,
newRange
);
if (selectionFullyContained) {
return selectionLayerUpdate(newRange);
}
let newRangeFullyContained = !trimRangeByAnotherRange(
newRange,
selectionLayer
);
let { newRange: range1 } = expandOrContractRangeToPosition(
selectionLayer,
newRange.start,
sequenceLength
);
let { newRange: range2 } = expandOrContractRangeToPosition(
selectionLayer,
newRange.end + 1,
sequenceLength
); //+1 to go from range end to position
let range1Shorter =
getRangeLength(range1, sequenceLength) <
end: selectionLayer.end
});
} else {
selectionLayerUpdate({
start: selectionLayer.start,
end: normalizePositionByRangeLength(
newCaret - 1,
sequenceLength,
true
)
});
}
} else {
//new range passed
// return selectionLayerUpdate(newRange);
let selectionFullyContained = !trimRangeByAnotherRange(
selectionLayer,
newRange
);
if (selectionFullyContained) {
return selectionLayerUpdate(newRange);
}
let newRangeFullyContained = !trimRangeByAnotherRange(
newRange,
selectionLayer
);
let { newRange: range1 } = expandOrContractRangeToPosition(
selectionLayer,
newRange.start,
sequenceLength
sequenceLength,
true
)
});
}
} else {
//new range passed
let selectionFullyContained = !trimRangeByAnotherRange(
selectionLayer,
newRange
);
if (selectionFullyContained) {
return selectionLayerUpdate(newRange);
}
let newRangeFullyContained = !trimRangeByAnotherRange(
newRange,
selectionLayer
);
let { newRange: range1 } = expandOrContractRangeToPosition(
selectionLayer,
newRange.start,
sequenceLength
);
let { newRange: range2 } = expandOrContractRangeToPosition(
selectionLayer,
newRange.end + 1,
sequenceLength
); //+1 to go from range end to position
let range1Shorter = getRangeLength(range1) < getRangeLength(range2);
start: newCaret,
end: selectionLayer.end
});
} else {
selectionLayerUpdate({
start: selectionLayer.start,
end: normalizePositionByRangeLength(
newCaret - 1,
sequenceLength,
true
)
});
}
} else {
//new range passed
let selectionFullyContained = !trimRangeByAnotherRange(
selectionLayer,
newRange
);
if (selectionFullyContained) {
return selectionLayerUpdate(newRange);
}
let newRangeFullyContained = !trimRangeByAnotherRange(
newRange,
selectionLayer
);
let { newRange: range1 } = expandOrContractRangeToPosition(
selectionLayer,
newRange.start,
sequenceLength