Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
enzymesToAdd: enzymesToAdd.map(function({ value }) {
const times = cutSequenceByRestrictionEnzyme(
inputSequenceToTestAgainst,
true,
value
).length;
return {
label:
value.name +
` (Cuts ${times} time${times === 1 ? "" : "s"})`,
value
};
})
});
if (
!enzyme.name ||
!enzyme.site ||
!enzyme.forwardRegex ||
!enzyme.reverseRegex ||
(!enzyme.topSnipOffset && enzyme.topSnipOffset !== 0) ||
(!enzyme.bottomSnipOffset && enzyme.bottomSnipOffset !== 0)
) {
invalid = true;
}
let matches;
if (regexString.length === 0) {
matches = [];
} else {
matches = cutSequenceByRestrictionEnzyme(
inputSequenceToTestAgainst,
true,
enzyme
);
}
const errors = validate(addAdditionalEnzymes);
if (Object.keys(errors || {}).length) {
invalid = true;
}
function onChange(updatedVal) {
dispatch({
type: "ADD_ADDITIONAL_ENZYMES_UPDATE",
payload: {
...addAdditionalEnzymes,
...updatedVal