mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-10-20 22:49:44 +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.
|
* the one farther down the graph, since that means it is closer to its child.
|
||||||
*
|
*
|
||||||
* @param {string[]} parents
|
* @param {string[]} parents
|
||||||
* @returns {string}
|
* @returns {string | undefined}
|
||||||
*/
|
*/
|
||||||
const findClosestParent = (parents) => {
|
const findClosestParent = (parents) => {
|
||||||
let closestParent = '';
|
let closestParent = '';
|
||||||
@@ -84,7 +84,7 @@ const findClosestParent = (parents) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return closestParent;
|
return closestParent || undefined;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user