Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

thinky

Package Overview
Dependencies
Maintainers
1
Versions
129
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

thinky - npm Package Compare versions

Comparing version 2.3.2 to 2.3.3

22

lib/type/number.js

@@ -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",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc