From 02246f64d2ae39150bba9476ffb3cf2eaf7414cf Mon Sep 17 00:00:00 2001 From: Matheus B Date: Tue, 16 Jan 2024 20:01:03 -0300 Subject: [PATCH] Include undefined on findClosestParent return types and update the function --- packages/mermaid/src/diagrams/git/gitGraphRenderer.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/mermaid/src/diagrams/git/gitGraphRenderer.js b/packages/mermaid/src/diagrams/git/gitGraphRenderer.js index d14404db4..f9df1db34 100644 --- a/packages/mermaid/src/diagrams/git/gitGraphRenderer.js +++ b/packages/mermaid/src/diagrams/git/gitGraphRenderer.js @@ -70,7 +70,7 @@ const drawText = (txt) => { * the one farther down the graph, since that means it is closer to its child. * * @param {string[]} parents - * @returns {string} + * @returns {string | undefined} */ const findClosestParent = (parents) => { let closestParent = ''; @@ -84,7 +84,7 @@ const findClosestParent = (parents) => { } }); - return closestParent; + return closestParent || undefined; }; /**