/**
 * This takes an {@linkcode EditChange} and a predicate that determines if a row
 * should be present based on the row's data. It then splits the change and
 * pushes the appropriate changes to the output based on the predicate.
 */
export function maybeSplitAndPushEditChange(change, predicate, output, pusher) {
    const oldWasPresent = predicate(change.oldNode.row);
    const newIsPresent = predicate(change.node.row);
    if (oldWasPresent && newIsPresent) {
        output.push(change, pusher);
    }
    else if (oldWasPresent && !newIsPresent) {
        output.push({
            type: 'remove',
            node: change.oldNode,
        }, pusher);
    }
    else if (!oldWasPresent && newIsPresent) {
        output.push({
            type: 'add',
            node: change.node,
        }, pusher);
    }
}
//# sourceMappingURL=maybe-split-and-push-edit-change.js.map