Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
render() {
const { sequenceData = {} } = this.props;
let filestring;
switch (this.state.fileTypeToView) {
case "fasta":
filestring = jsonToFasta(sequenceData);
break;
case "teselagen":
filestring = JSON.stringify(
cleanUpTeselagenJsonForExport(sequenceData),
null,
4
);
break;
default:
filestring = jsonToGenbank(sequenceData);
}
return (
<div>
{
this.setState({ fileTypeToView: e.target.value });
}}
/>
</div>
function getGenbankFromSelection(selectedSeqData, sequenceData) {
const spansEntireSeq =
sequenceData.sequence.length === selectedSeqData.sequence.length;
const feats = map(selectedSeqData.features);
const just1Feat = feats.length === 1;
return {
sequence: jsonToGenbank({
...selectedSeqData,
name: spansEntireSeq
? selectedSeqData.name
: just1Feat
? feats[0].name
: selectedSeqData.name + "_partial",
circular: spansEntireSeq ? selectedSeqData.circular : false
})
};
}