var GT=1,LT=-1,EQ=0;function compareItem(r,t){return"number"!=typeof r&&(r=0),"number"!=typeof t&&(t=0),r>t?GT:r<t?LT:EQ}function compareVersion(r,t){void 0===r&&(r=""),void 0===t&&(t="");var e=/^\d+(\.\d+){2,3}$/;if(!e.test(r)||!e.test(t))throw new Error("请传入正确的版本号格式");for(var n=(""+r).split(".").map((function(r){return parseInt(r,10)})),o=(""+t).split(".").map((function(r){return parseInt(r,10)})),a=Math.max(n.length,o.length),p=0,i=0;i<a&&(p=compareItem(n[i],o[i]))===EQ;i++);return p}export default compareVersion;