mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-26 10:49:38 +02:00
refactor: convert if-statements to switch..case
This commit is contained in:
@@ -832,14 +832,15 @@ const getTypeFromVertex = (vertex: FlowVertex) => {
|
||||
}
|
||||
return 'icon';
|
||||
}
|
||||
if (vertex.type === 'square') {
|
||||
return 'squareRect';
|
||||
switch (vertex.type) {
|
||||
case 'square':
|
||||
case undefined:
|
||||
return 'squareRect';
|
||||
case 'round':
|
||||
return 'roundedRect';
|
||||
default:
|
||||
return vertex.type;
|
||||
}
|
||||
if (vertex.type === 'round') {
|
||||
return 'roundedRect';
|
||||
}
|
||||
|
||||
return vertex.type ?? 'squareRect';
|
||||
};
|
||||
|
||||
const findNode = (nodes: Node[], id: string) => nodes.find((node) => node.id === id);
|
||||
|
Reference in New Issue
Block a user