mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-11-15 18:24:33 +01:00
warn if unknown node property is given
This commit is contained in:
@@ -324,10 +324,15 @@ const rect = (parent, node) => {
|
|||||||
.attr('y', -bbox.height / 2 - halfPadding)
|
.attr('y', -bbox.height / 2 - halfPadding)
|
||||||
.attr('width', totalWidth)
|
.attr('width', totalWidth)
|
||||||
.attr('height', totalHeight);
|
.attr('height', totalHeight);
|
||||||
// TODO warn if unknown property is given
|
|
||||||
|
const propKeys = new Set(Object.keys(node.props));
|
||||||
if (node.props?.borders) {
|
if (node.props?.borders) {
|
||||||
applyNodePropertyBorders(rect, node.props.borders, totalWidth, totalHeight);
|
applyNodePropertyBorders(rect, node.props.borders, totalWidth, totalHeight);
|
||||||
|
propKeys.delete('borders');
|
||||||
}
|
}
|
||||||
|
propKeys.forEach((propKey) => {
|
||||||
|
log.warn(`Unknown node property ${propKey}`);
|
||||||
|
});
|
||||||
|
|
||||||
updateNodeBounds(node, rect);
|
updateNodeBounds(node, rect);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user