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