This commit is contained in:
cubedro 2015-05-27 13:41:35 +03:00
parent 7ae41cbe63
commit 32001c1cab
5 changed files with 9 additions and 8 deletions

1
app.js
View File

@ -19,7 +19,6 @@ if( process.env.NODE_ENV !== 'production' )
var express = require('express');
var app = express();
var path = require('path');
var favicon = require('serve-favicon');
var bodyParser = require('body-parser');
// view engine setup

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -21,7 +21,6 @@
"primus": "3.0.2",
"primus-emit": "0.1.2",
"primus-spark-latency": "0.1.1",
"serve-favicon": "2.2.1",
"ws": "0.7.2"
},
"repository": {

View File

@ -542,15 +542,17 @@ angular.module('netStatsApp.filters', [])
};
});
function compareVersions(v1, comparator, v2) {
"use strict";
console.log(v1, comparator, v2);
function compareVersions(v1, comparator, v2)
{
comparator = comparator == '=' ? '==' : comparator;
var v1parts = v1.split('.'), v2parts = v2.split('.');
var maxLen = Math.max(v1parts.length, v2parts.length);
var part1, part2;
var cmp = 0;
for(var i = 0; i < maxLen && !cmp; i++) {
for(var i = 0; i < maxLen && !cmp; i++)
{
part1 = parseInt(v1parts[i], 10) || 0;
part2 = parseInt(v2parts[i], 10) || 0;
if(part1 < part2)
@ -558,6 +560,7 @@ function compareVersions(v1, comparator, v2) {
if(part1 > part2)
cmp = -1;
}
return eval('0' + comparator + cmp);
}