Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
let orginalSeq = isSelection
? getSequenceWithinRange(selectionLayer, sequence)
: sequence;
if (type.includes("flip")) {
newSeq = invertString(orginalSeq);
} else {
newSeq = orginalSeq[func]();
}
if (newSeq !== orginalSeq) {
!toastFired &&
window.toastr.success(`Sequence Case Edited Successfully`);
//don't trigger a mutation unless something has actually changed
props.updateSequenceData({
...props.sequenceData,
sequence: isSelection
? adjustBpsToReplaceOrInsert(
sequence,
newSeq,
selectionLayer,
false
)
: newSeq
});
}
}
};