From cdca63dcfe81804c5e48721522aefe0d75175b1d Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Sat, 27 Jul 2024 15:18:09 +0530 Subject: [PATCH] chore: Simplify dataFetcher helper functions --- packages/mermaid/src/diagrams/state/dataFetcher.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/mermaid/src/diagrams/state/dataFetcher.js b/packages/mermaid/src/diagrams/state/dataFetcher.js index ec4b0518b8..31f459b9e2 100644 --- a/packages/mermaid/src/diagrams/state/dataFetcher.js +++ b/packages/mermaid/src/diagrams/state/dataFetcher.js @@ -198,10 +198,10 @@ export const dataFetcher = ( if (itemId !== 'root') { let shape = SHAPE_STATE; + // The if === true / false can be removed if we can guarantee that the parsedItem.start is always a boolean if (parsedItem.start === true) { shape = SHAPE_START; - } - if (parsedItem.start === false) { + } else if (parsedItem.start === false) { shape = SHAPE_END; } if (parsedItem.type !== DEFAULT_STATE_TYPE) {