mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-22 08:50:13 +02:00
fix: check if node.prop
is defined
This commit is contained in:
@@ -325,14 +325,16 @@ const rect = (parent, node) => {
|
|||||||
.attr('width', totalWidth)
|
.attr('width', totalWidth)
|
||||||
.attr('height', totalHeight);
|
.attr('height', totalHeight);
|
||||||
|
|
||||||
const propKeys = new Set(Object.keys(node.props));
|
if (node.props) {
|
||||||
if (node.props?.borders) {
|
const propKeys = new Set(Object.keys(node.props));
|
||||||
applyNodePropertyBorders(rect, node.props.borders, totalWidth, totalHeight);
|
if (node.props.borders) {
|
||||||
propKeys.delete('borders');
|
applyNodePropertyBorders(rect, node.props.borders, totalWidth, totalHeight);
|
||||||
|
propKeys.delete('borders');
|
||||||
|
}
|
||||||
|
propKeys.forEach((propKey) => {
|
||||||
|
log.warn(`Unknown node property ${propKey}`);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
propKeys.forEach((propKey) => {
|
|
||||||
log.warn(`Unknown node property ${propKey}`);
|
|
||||||
});
|
|
||||||
|
|
||||||
updateNodeBounds(node, rect);
|
updateNodeBounds(node, rect);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user