Comparing version 2.3.2 to 2.3.3
@@ -5,4 +5,4 @@ var util = require(__dirname+'/../util.js'); | ||
function TypeNumber() { | ||
this._min = -1; | ||
this._max = -1; | ||
this._min = undefined; | ||
this._max = undefined; | ||
this._integer = false; | ||
@@ -67,4 +67,4 @@ this._default = undefined; | ||
TypeNumber.prototype.min = function(min) { | ||
if (min < 0) { | ||
throw new Errors.ValidationError("The value for `min` must be a positive integer"); | ||
if ((typeof(min) !== 'number') || (isFinite(min) == false)) { | ||
throw new Errors.ValidationError("The value for `min` must be a finite number"); | ||
} | ||
@@ -77,4 +77,4 @@ this._min = min; | ||
TypeNumber.prototype.max = function(max) { | ||
if (max < 0) { | ||
throw new Errors.ValidationError("The value for `max` must be a positive integer"); | ||
if ((typeof(max) !== 'number') || (isFinite(max) == false)) { | ||
throw new Errors.ValidationError("The value for `max` must be a finite number"); | ||
} | ||
@@ -134,9 +134,9 @@ this._max = max; | ||
else { | ||
if ((this._min !== -1) && (this._min > number)){ | ||
throw new Errors.ValidationError("Value for "+prefix+" must be greater than "+this._min+".") | ||
if ((this._min !== undefined) && (this._min > number)){ | ||
throw new Errors.ValidationError("Value for "+prefix+" must be greater than or equal to "+this._min+".") | ||
} | ||
if ((this._max !== -1) && (this._max < number)){ | ||
throw new Errors.ValidationError("Value for "+prefix+" must be less than "+this._max+".") | ||
if ((this._max !== undefined) && (this._max < number)){ | ||
throw new Errors.ValidationError("Value for "+prefix+" must be less than or equal to "+this._max+".") | ||
} | ||
if ((this._integer === true) && (number%1 !== 0)){ | ||
if ((this._integer === true) && (number % 1 !== 0)){ | ||
throw new Errors.ValidationError("Value for "+prefix+" must be an integer.") | ||
@@ -143,0 +143,0 @@ } |
{ | ||
"name": "thinky", | ||
"version": "2.3.2", | ||
"version": "2.3.3", | ||
"description": "RethinkDB ORM for Node.js", | ||
@@ -5,0 +5,0 @@ "main": "lib/thinky.js", |
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
222054