Comparing version 0.2.10 to 0.2.11
{ | ||
"name": "statware", | ||
"description": "Status aggregation suite with middle-ware like abilities. Used by the Ravenwall agent.", | ||
"version": "0.2.10", | ||
"version": "0.2.11", | ||
"author": "Bryce B. Baril <bryce@ravenwall.com>", | ||
@@ -6,0 +6,0 @@ "dependencies": { |
18
stats.js
@@ -34,21 +34,21 @@ module.exports = Stats | ||
Stats.prototype.set = function (key, value) { | ||
this.status[key] = value | ||
this._stats[key] = value | ||
} | ||
Stats.prototype.increment = function (key) { | ||
if (isNaN(this.status[key])) { | ||
this.status[key] = 1 | ||
if (isNaN(this._stats[key])) { | ||
this._stats[key] = 1 | ||
} | ||
else { | ||
this.status[key]++ | ||
this._stats[key]++ | ||
} | ||
} | ||
Stats.prototype.incrementHash = function (key, subkey) { | ||
if (this.status[key] === undefined) { | ||
this.status[key] = {} | ||
if (this._stats[key] === undefined) { | ||
this._stats[key] = {} | ||
} | ||
if (isNaN(this.status[key][subkey])) { | ||
this.status[key][subkey] = 1 | ||
if (isNaN(this._stats[key][subkey])) { | ||
this._stats[key][subkey] = 1 | ||
} | ||
else { | ||
this.status[key][subkey]++ | ||
this._stats[key][subkey]++ | ||
} | ||
@@ -55,0 +55,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package