ensureNodeExists method

void ensureNodeExists(
  1. 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.',
  );
}