foldKeptNodes<R> method

R foldKeptNodes<R>(
  1. R initial,
  2. R fn(
    1. Path path,
    2. R accumulator
    )
)

Folds fn over the kept paths.

Implementation

R foldKeptNodes<R>(R initial, R Function(Path path, R accumulator) fn) =>
    forest.foldValues<R>(
      initial,
      (Path relativePath, bool prune, R accumulator) =>
          prune ? accumulator : fn(relativePath, accumulator),
    );