From 9996e53e24cced6bbfc0681161345cc0a313a1d8 Mon Sep 17 00:00:00 2001 From: "Ashley Engelund (weedySeaDragon @ github)" Date: Tue, 15 Nov 2022 08:50:20 -0800 Subject: [PATCH] (minor) add comments, remove duplicated line --- packages/mermaid/src/diagrams/state/stateDb.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/mermaid/src/diagrams/state/stateDb.js b/packages/mermaid/src/diagrams/state/stateDb.js index 914ac7410..cf012fc2c 100644 --- a/packages/mermaid/src/diagrams/state/stateDb.js +++ b/packages/mermaid/src/diagrams/state/stateDb.js @@ -31,8 +31,13 @@ const FILL_KEYWORD = 'fill'; const BG_FILL = 'bgFill'; const STYLECLASS_SEP = ','; -// Returns a new list of classes. -// In the future, this can be replaced with a class common to all diagrams. +/** + * Returns a new list of classes. + * In the future, this can be replaced with a class common to all diagrams. + * ClassDef information = { id: id, styles: [], textStyles: [] } + * + * @return {{}} + */ function newClassesList() { return {}; } @@ -276,8 +281,6 @@ export const clear = function (saveCommon) { }; currentDocument = documents.root; - currentDocument = documents.root; - // number of start and end nodes; used to construct ids startEndCount = 0; classes = newClassesList(); @@ -453,7 +456,7 @@ const getDividerId = () => { export const addStyleClass = function (id, styleAttributes = '') { // create a new style class object with this id if (typeof classes[id] === 'undefined') { - classes[id] = { id: id, styles: [], textStyles: [] }; + classes[id] = { id: id, styles: [], textStyles: [] }; // This is a classDef } const foundClass = classes[id]; if (typeof styleAttributes !== 'undefined') {