"use strict";
/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.prune = void 0;
const markListFactory_1 = require("./markListFactory");
const utils_1 = require("./utils");
function prune(changeset, pruneNode) {
    const pruned = new markListFactory_1.MarkListFactory();
    for (const mark of changeset) {
        if (mark.changes !== undefined) {
            pruned.push((0, utils_1.withNodeChange)(mark, pruneNode(mark.changes)));
        }
        else {
            pruned.push(mark);
        }
    }
    return pruned.list;
}
exports.prune = prune;
//# sourceMappingURL=prune.js.map