cleanup
This commit is contained in:
parent
7ae41cbe63
commit
32001c1cab
1
app.js
1
app.js
@ -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
|
||||
|
2
dist/js/netstats.min.js
vendored
2
dist/js/netstats.min.js
vendored
File diff suppressed because one or more lines are too long
2
dist/js/netstats.min.js.map
vendored
2
dist/js/netstats.min.js.map
vendored
File diff suppressed because one or more lines are too long
@ -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": {
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user