text: "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  function getLargestVersionFromIntersection(v1, v2) {
      let intersection = v1.filter((value) => v2.indexOf(value) !== -1);
      if (intersection.length === 0) {
          return undefined;
      }
      let maxVersionSoFar = intersection[0];
      for (let i = 1; i < intersection.length; i++) {
          maxVersionSoFar = maxVersion(intersection[i], maxVersionSoFar);
      }
      return maxVersionSoFar;
  }
  exports.getLargestVersionFromIntersection = getLargestVersionFromIntersection;
  function maxVersion(version1, version2) {
      let splittedv1 = version1.split(".");
      let splittedv2 = version2.split(".");
      let minLength = Math.min(splittedv1.length, splittedv2.length);
      for (let i = 0; i < minLength; i++) {
          let v1 = Number(splittedv1[i]);
          let v2 = Number(splittedv2[i]);
          if (v1 > v2) {
              return version1;
          } else if (v2 > v1) {
              return version2;
          }
      }
      if (splittedv1.length >= splittedv2.length) {
          return version1;
      }
      return version2;
  }
  exports.maxVersion = maxVersion;
  //# sourceMappingURL=utils.js.map
  