mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-10-16 20:49:45 +02:00
Include undefined on findClosestParent return types and update the function
This commit is contained in:
@@ -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;
|
||||
};
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user