{"size": 404, "ext": "js", "max_stars_repo_path": "node_modules/licia/cmpVersion.js", "max_stars_repo_name": "xueduany/chii", "max_stars_repo_stars_event_min_datetime": "2021-03-04T09:24:45.000Z", "max_stars_repo_stars_event_max_datetime": "2021-03-04T09:24:45.000Z", "max_issues_repo_path": "node_modules/licia/cmpVersion.js", "max_issues_repo_name": "xueduany/chii", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "node_modules/licia/cmpVersion.js", "max_forks_repo_name": "xueduany/chii", "max_forks_repo_forks_event_min_datetime": "2021-03-04T09:25:23.000Z", "max_forks_repo_forks_event_max_datetime": "2021-03-07T03:48:28.000Z"}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": 2, "avg_line_length": 20.2, "max_line_length": 40, "alphanum_fraction": 0.5}
var toInt = require('./toInt');
var max = require('./max');

exports = function(v1, v2) {
    v1 = v1.split('.');
    v2 = v2.split('.');
    var len = max(v1.length, v2.length);

    for (var i = 0; i < len; i++) {
        var num1 = toInt(v1[i]);
        var num2 = toInt(v2[i]);
        if (num1 > num2) return 1;
        if (num1 < num2) return -1;
    }

    return 0;
};

module.exports = exports;
