比较两个版本号
@param version1 {String} || {Number} 版本号1
@param version2 {String} || {Number} 版本号2
@return {Number} 1, 大于；0 等于；-1 小于
487933
function (version1, version2) {
    try {
      if (lodash.isNumber(version1) && lodash.isNumber(version2)) {
        if (version1 > version2) { return 1 }
        if (version1 === version2) { return 0 }
        if (version1 < version2) { return -1 }
      } else if (lodash.isNumber(version1) || lodash.isNumber(version2)) {
        version1 += '';
        version2 += '';
      }

      var version1Array = version1.split('.');
      var version2Array = version2.split('.');

      var ver1IntList = [];
      var ver2IntList = [];

      version1Array.forEach(function (value, index, array) {
        ver1IntList.push(parseInt(value));
      });

      version2Array.forEach(function (value, index, array) {
        ver2IntList.push(parseInt(value));
      });

      // format
      if (ver1IntList.length < ver2IntList.length) {
        var i = 0;
        for (; i < (ver2IntList.length - ver1IntList.length); ++i) {
          ver1IntList.push(0);
        }
      }

      if (ver1IntList.length > ver2IntList.length) {
        var i$1 = 0;
        for (; i$1 < (ver1IntList.length - ver2IntList.length); ++i$1) {
          ver2IntList.push(0);
        }
      }

      var i$2 = 0;
      for (; i$2 < ver1IntList.length; ++i$2) {
        var cVer1 = ver1IntList[i$2];
        var cVer2 = ver2IntList[i$2];

        if (cVer1 > cVer2) { return 1 }
        if (cVer1 < cVer2) { return -1 }
      }

      return 0
    } catch (e) {
      return -1
    }
  }
1055911
public int compareTo(Version version) {
        int mine = (1000 * major) + (100 * minor) + (revision * 10);
        int theirs = (1000 * version.major) + (100 * version.minor) + (version.revision * 10);

        if (mine == theirs && tag != null && version.tag != null) {
            return version.tag.compareTo(tag);
        } else if (mine == theirs && tag == null && version.tag != null) {
            return -1;
        } else if (mine == theirs && tag != null && version.tag == null) {
            return 1;
        } else {
            return mine - theirs;
        }
    }
828900
def _version_less_than_or_equal_to(self, v1, v2):
        
        # pylint: disable=no-name-in-module, import-error
        from distutils.version import LooseVersion
        return LooseVersion(v1) <= LooseVersion(v2)
876047
function getBrowserVersion(version) {
  if (!version) {
    return {
      major: '',
      minor: '',
    };
  }
  var parts = version.split('.');
  return {
    major: parts[0],
    minor: parts[1],
  };
}
203199
function hasEmberVersion(major, minor) {
  const numbers = VERSION.split('-')[0].split('.');
  const actualMajor = parseInt(numbers[0], 10);
  const actualMinor = parseInt(numbers[1], 10);
  return actualMajor > major || (actualMajor === major && actualMinor >= minor);
}
206096
public static boolean greaterOrEqualsVersion(String versionA, String versionB) {
        String largerVersion = extractLargerVersion(versionA, versionB);
        return largerVersion != null && largerVersion.equals(versionA);
    }
428604
function parseVersion(str) {
  var match = /git version ([0-9\.]+)/.exec(str);

  if (match) {
    return match[1];
  } else {
    throw new Error('Unable to parse version response', str);
  }
}
1104597
function numberedVersionData(version) {
  // A version has a numbered part and a modifier part
  // (eg, 1.0.0-patch, 2.0.x-dev).
  const parts = version.split('-')
  const numbered = parts[0]

  // Aliases that get caught here.
  if (numbered === 'dev') {
    return {
      numbers: parts[1],
      modifier: 5,
      modifierCount: 1,
    }
  }

  let modifierLevel = 3
  let modifierLevelCount = 0

  if (parts.length > 1) {
    const modifier = parts[parts.length - 1]
    const firstLetter = modifier.charCodeAt(0)
    let modifierLevelCountString

    // Modifiers: alpha < beta < RC < normal < patch < dev
    if (firstLetter === 97) {
      // a
      modifierLevel = 0
      if (/^alpha/.test(modifier)) {
        modifierLevelCountString = +modifier.slice(5)
      } else {
        modifierLevelCountString = +modifier.slice(1)
      }
    } else if (firstLetter === 98) {
      // b
      modifierLevel = 1
      if (/^beta/.test(modifier)) {
        modifierLevelCountString = +modifier.slice(4)
      } else {
        modifierLevelCountString = +modifier.slice(1)
      }
    } else if (firstLetter === 82) {
      // R
      modifierLevel = 2
      modifierLevelCountString = +modifier.slice(2)
    } else if (firstLetter === 112) {
      // p
      modifierLevel = 4
      if (/^patch/.test(modifier)) {
        modifierLevelCountString = +modifier.slice(5)
      } else {
        modifierLevelCountString = +modifier.slice(1)
      }
    } else if (firstLetter === 100) {
      // d
      modifierLevel = 5
      if (/^dev/.test(modifier)) {
        modifierLevelCountString = +modifier.slice(3)
      } else {
        modifierLevelCountString = +modifier.slice(1)
      }
    }

    // If we got the empty string, it defaults to a modifier count of 1.
    if (!modifierLevelCountString) {
      modifierLevelCount = 1
    } else {
      modifierLevelCount = +modifierLevelCountString
    }
  }

  // Try to convert to a list of numbers.
  function toNum(s) {
    let n = +s
    if (Number.isNaN(n)) {
      n = 0xffffffff
    }
    return n
  }
  const numberList = numbered.split('.').map(toNum)

  return {
    numbers: numberList,
    modifier: modifierLevel,
    modifierCount: modifierLevelCount,
  }
}
146233
function getVersionSlice() {
		var era = prefs.get('caniuse.era');
		var ix = erasDB.indexOf(era);
		if (!~ix) {
			ix = erasDB.indexOf('e-2');
		}

		return ix;
	}
369090
function getVersion() {
        if (_baseVersion[2] > 8) {
            _baseVersion[2] = 0;
            _baseVersion[1]++;
            if (_baseVersion[1] > 8) {
                _baseVersion[1] = 0;
                _baseVersion[0]++;
            }
        } else {
            _baseVersion[2]++;
        }
        return _baseVersion.join('.');
    }
927391
public static VersionNumber parseVersion(@Nonnull final String version) {
		return VersionParser.parseVersion(Check.notNull(version, "version"));
	}
309791
def version_cmp(version_a, version_b):
    """"""
    a = normalize_version(version_a)
    b = normalize_version(version_b)

    i_a = a[0] * 100 + a[1] * 10 + a[0] * 1
    i_b = b[0] * 100 + b[1] * 10 + b[0] * 1

    return i_a - i_b
856766
def version_greater(minimum, version):
    

    # Chop up the version strings
    minimum = [int(i) for i in minimum.split('.')]
    version = [int(i) for i in version.split('.')]

    # Compare the versions element by element
    for mini, vers in zip(minimum, version):
        if vers < mini:
            # If it's less than, we definitely don't match
            return False
        elif vers > mini:
            # If it's greater than, we definitely match
            return True

        # OK, the elements are equal; loop around and check out the
        # next element

    # All elements are equal
    return True
117599
function calculateVersion(officialRelease, callback) {
    var version = require('./package.json').version;

    if (officialRelease) {
        callback(version);
    } else {
        git.short(function (str) {
            callback(version + '+' + str);
        });
    }
}
954255
public static int compareVersions(String v1, String v2) {
		String[] v1a = v1.split("\\.");
		String[] v2a = v2.split("\\.");
		Integer v1M = Integer.parseInt(v1a[0]);
		Integer v2M = Integer.parseInt(v2a[0]);
		if (v1M < v2M) {
			return -1;
		} else if (v1M > v2M) {
			return 1;
		} else {
			Integer v1min = Integer.parseInt(v1a[1]);
			Integer v2min = Integer.parseInt(v2a[1]);
			if (v1min < v2min) {
				return -1;
			} else if (v1min > v2min) {
				return 1;
			} else {
				return 0;
			}
		}
	}
192684
function (version) {
    var splitDots = version.split(".");
    var nbDots = splitDots.length - 1;
    if (nbDots === 0) {
        return version + ".0.0";
    } else if (nbDots === 1) {
        return version + ".0";
    } else if (nbDots === 2) {
        return version;
    } else {
        return splitDots.slice(0, 3).join(".") + "-" + splitDots.slice(3).join(".");
    }
}
1094892
function toVersionString(versions) {
  return Object.keys(versions).sort().filter(key => versions[key]).map((key) => {
    return versions[key] ? `${key}@${versions[key]}` : '';
  }).join(', ');
}