import { unreachable } from "../../../shared/src/asserts.js";
import { maybeSplitAndPushEditChange } from "./maybe-split-and-push-edit-change.js";
function* filterPush(change, output, pusher, predicate) {
  if (!predicate) {
    yield* output.push(change, pusher);
    return;
  }
  switch (change.type) {
    case "add":
    case "remove":
      if (predicate(change.node.row)) {
        yield* output.push(change, pusher);
      }
      break;
    case "child":
      if (predicate(change.node.row)) {
        yield* output.push(change, pusher);
      }
      break;
    case "edit":
      yield* maybeSplitAndPushEditChange(change, predicate, output, pusher);
      break;
    default:
      unreachable();
  }
}
export {
  filterPush
};
//# sourceMappingURL=filter-push.js.map
