ensureNodeExists method
void
ensureNodeExists(
- N node
Implementation
void ensureNodeExists(N node) {
nodes.putIfAbsent(node.id, () => node);
assert(
nodes.containsKey(node.id),
'The node with ID ${node.id} was not added to the graph.',
);
}