def snapshot_map(snapshots, &block)
      applier = lambda do |snapshot|
        return if !snapshot || snapshot.empty?

        snapshot[:children].each do |child|
          applier.call(child)
        end

        block.call(snapshot)
      end

      applier.call(snapshots)
    end
def snapshot_map(snapshots, &block)
      applier = lambda do |snapshot|
        return if !snapshot || snapshot.empty?

        snapshot[:children].each do |child|
          applier.call(child)
        end

        block.call(snapshot)
      end

      applier.call(snapshots)
    end
Applies a function to every snapshot.