"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.action = void 0;
const utils_1 = require("../../utils");
const system_settings_1 = require("@ewizardjs/system-settings");
function action() {
    return (deps = [], options) => __awaiter(this, void 0, void 0, function* () {
        const packageLock = yield (0, utils_1.getPackageLockFile)(options.cwd);
        if ((packageLock === null || packageLock === void 0 ? void 0 : packageLock.lockfileVersion) === 1) {
            options.npmVersion = system_settings_1.NpmVersion.Legacy;
        }
        const npmController = yield (0, utils_1.getNpmController)(options);
        return npmController.uninstall(deps);
    });
}
exports.action = action;
//# sourceMappingURL=action.js.map