"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_js_1 = require("./markListFactory.js");
const utils_js_1 = require("./utils.js");
function prune(changeset, pruneNode) {
    const pruned = new markListFactory_js_1.MarkListFactory();
    for (let mark of changeset) {
        if (mark.changes !== undefined) {
            mark = (0, utils_js_1.withNodeChange)(mark, pruneNode(mark.changes));
        }
        pruned.push(mark);
    }
    return pruned.list;
}
exports.prune = prune;
//# sourceMappingURL=prune.js.map