warn if unknown node property is given

This commit is contained in:
Michael Maier 2021-11-28 12:38:51 +01:00
parent 9e8c03cb49
commit b6d3ac8e32
1 changed files with 6 additions and 1 deletions

View File

@ -324,10 +324,15 @@ const rect = (parent, node) => {
.attr('y', -bbox.height / 2 - halfPadding)
.attr('width', totalWidth)
.attr('height', totalHeight);
// TODO warn if unknown property is given
const propKeys = new Set(Object.keys(node.props));
if (node.props?.borders) {
applyNodePropertyBorders(rect, node.props.borders, totalWidth, totalHeight);
propKeys.delete('borders');
}
propKeys.forEach((propKey) => {
log.warn(`Unknown node property ${propKey}`);
});
updateNodeBounds(node, rect);