"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const logger_1 = require("@pnpm/logger");
async function default_1(opts) {
    const reporter = opts && opts.reporter;
    if (reporter) {
        logger_1.streamParser.on('data', reporter);
    }
    await opts.storeController.prune();
    await opts.storeController.saveState();
    await opts.storeController.close();
    if (reporter) {
        logger_1.streamParser.removeListener('data', reporter);
    }
}
exports.default = default_1;
