prune method

PruneForest prune(
  1. Path path
)

With path pruned.

Implementation

PruneForest prune(Path path) {
  if (forest.rootMostValueMatching(path, _keepPredicate) != null) {
    throw ArgumentError("Can't prune path that was kept previously!");
  }
  if (forest.rootMostValueMatching(path, _prunePredicate) != null) {
    // This path will already be pruned.
    return this;
  }
  return PruneForest.fromTree(forest.setTree(path, _pruneTree));
}