/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { MarkListFactory } from "./markListFactory";
import { omitMarkEffect, withNodeChange } from "./utils";
export function prune(changeset, pruneNode) {
    const pruned = new MarkListFactory();
    for (let mark of changeset) {
        if (mark.changes !== undefined) {
            mark = withNodeChange(mark, pruneNode(mark.changes));
        }
        if (mark.type === "Placeholder") {
            mark = omitMarkEffect(mark);
        }
        pruned.push(mark);
    }
    return pruned.list;
}
//# sourceMappingURL=prune.js.map