智能照明系统APP-本地串口
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
LightingSystemApp-serial/.svn/pristine/ef/ef5ec028b374856aec1abaf332c...

19 lines
404 B

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;