carpenterTreeContains<T> function

bool carpenterTreeContains<T>(
  1. CarpenterTreeNode<T> root,
  2. Object id
)

Implementation

bool carpenterTreeContains<T>(CarpenterTreeNode<T> root, Object id) {
  if (root.id == id) return true;
  return root.children.any((child) => carpenterTreeContains(child, id));
}