Skip to content

Commit

Permalink
#4380 - Refactor (getDefaultPreset.ts): Simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitriiP-EPAM committed May 20, 2024
1 parent 8d7de97 commit 858e108
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/ketcher-macromolecules/src/helpers/getDefaultPreset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,21 @@ export const getDefaultPresets = (
}),
);
// TODO: Do we need to check for existence? Suddenly there is `undefined`.
const ribose = rnaPartsMonomerLibraryItemByMonomerClassMap.get(
KetMonomerClass.Sugar,
) as MonomerItemType;
const rnaBase = rnaPartsMonomerLibraryItemByMonomerClassMap.get(
const base = rnaPartsMonomerLibraryItemByMonomerClassMap.get(
KetMonomerClass.Base,
) as MonomerItemType;
const phosphate = rnaPartsMonomerLibraryItemByMonomerClassMap.get(
KetMonomerClass.Phosphate,
) as MonomerItemType;
const sugar = rnaPartsMonomerLibraryItemByMonomerClassMap.get(
KetMonomerClass.Sugar,
) as MonomerItemType;
const result: IRnaPreset = {
base: { ...rnaBase, label: rnaBase.props.MonomerName },
base: { ...base, label: base.props.MonomerName },
default: true,
name: rnaPresetsTemplate.name,
phosphate: { ...phosphate, label: phosphate.props.MonomerName },
sugar: { ...ribose, label: ribose.props.MonomerName },
sugar: { ...sugar, label: sugar.props.MonomerName },
};
if (!rnaPresetsTemplate.idtAliases) {
return result;
Expand Down

0 comments on commit 858e108

Please sign in to comment.