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 1.13.11 to 1.13.12

52

lib/model.js

@@ -905,7 +905,49 @@ var util = require(__dirname+'/util.js');

(function(key) {
Model.prototype[key] = function() {
var query = new Query(this);
query = query[key].apply(query, arguments);
return query;
}
switch (key) {
case 'orderBy':
Model.prototype[key] = function() {
var query = new Query(this);
if ((arguments.length === 1)
&& (typeof arguments[0] === 'string')
&& (this._getModel()._indexes[arguments[0]] === true)) {
query = query[key]({index: arguments[0]});
return query;
}
else {
query = query[key].apply(query, arguments);
return query;
}
}
break;
case 'filter':
Model.prototype[key] = function() {
var query = new Query(this);
if ((arguments.length === 1)
&& (util.isPlainObject(arguments[0]))) {
var keys = Object.keys(arguments[0]);
if ((keys.length === 1) && (this._getModel()._indexes[keys[0]] === true)) {
query = query.getAll(arguments[0][keys[0]], {index: keys[0]});
return query;
}
else {
query = query[key].apply(query, arguments);
return query;
}
}
else {
query = query[key].apply(query, arguments);
return query;
}
}
break;
default:
Model.prototype[key] = function() {
var query = new Query(this);
query = query[key].apply(query, arguments);
return query;
}
}
})(key);

@@ -912,0 +954,0 @@ }

44

lib/query.js

@@ -259,43 +259,5 @@ var Promise = require('bluebird');

(function(key) {
switch (key) {
case 'orderBy':
Query.prototype[key] = function() {
if ((arguments.length === 1)
&& (typeof arguments[0] === 'string')
&& (this._model._indexes[arguments[0]] === true)) {
this._query = this._query[key]({index: arguments[0]});
return this;
}
else {
return new Query(this._model, this._query[key].apply(this._query, arguments));
}
}
break;
case 'filter':
Query.prototype[key] = function() {
if ((arguments.length === 1)
&& (util.isPlainObject(arguments[0]))) {
var keys = Object.keys(arguments[0]);
if ((keys.length === 1) && (this._model._indexes[keys[0]] === true)) {
this._query = this._query.getAll(arguments[0][keys[0]], {index: keys[0]});
return this;
}
else {
return new Query(this._model, this._query[key].apply(this._query, arguments));
}
}
else {
return new Query(this._model, this._query[key].apply(this._query, arguments));
}
}
break;
default:
Query.prototype[key] = function() {
return new Query(this._model, this._query[key].apply(this._query, arguments));
}
}
Query.prototype[key] = function() {
return new Query(this._model, this._query[key].apply(this._query, arguments));
}
})(key);

@@ -302,0 +264,0 @@ }

{
"name": "thinky",
"version": "1.13.11",
"version": "1.13.12",
"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