text: "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  const Rule_1 = require("./Rule");
  class ResolutionRule extends Rule_1.Rule {
      constructor(packageName, packageVersion) {
          super();
          this.packageName = packageName;
          this.packageVersion = packageVersion;
      }
      get title() {
          return this.packageName;
      }
      get description() {
          return `Add resolution for package ${this.packageName}`;
      }
      ;
      get resolution() {
          return `{
    "resolutions": {
      "${this.packageName}": "${this.packageVersion}"
    }
  }`;
      }
      ;
      get resolutionType() {
          return 'json';
      }
      ;
      get severity() {
          return 'Required';
      }
      ;
      get file() {
          return './package.json';
      }
      ;
      customCondition(project) {
          return false;
      }
      visit(project, findings) {
          if (!project.packageJson) {
              return;
          }
          if (this.customCondition(project) &&
              (!project.packageJson.resolutions ||
                  project.packageJson.resolutions[this.packageName] !== this.packageVersion)) {
              this.addFinding(findings);
          }
      }
  }
  exports.ResolutionRule = ResolutionRule;
  //# sourceMappingURL=ResolutionRule.js.map