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

penseur

Package Overview
Dependencies
Maintainers
1
Versions
103
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

penseur - npm Package Compare versions

Comparing version 1.5.2 to 2.0.0

6

lib/db.js

@@ -211,1 +211,7 @@ // Load Modules

};
internals.Db.prototype.fields = function (criteria) {
return new Table.Criteria(criteria, 'fields');
};

31

lib/table.js

@@ -34,3 +34,3 @@ // Load Modules

this._run(this._table.filter(criteria), 'query', criteria, callback);
this._run(internals.wrap(criteria).select(this._table), 'query', criteria, callback);
};

@@ -43,3 +43,3 @@

this._run(this._table.filter(criteria), 'single', criteria, callback, function (ignore, result) {
this._run(internals.wrap(criteria).select(this._table), 'single', criteria, callback, function (ignore, result) {

@@ -59,5 +59,5 @@ if (!result) {

internals.Table.prototype.count = function (criteria, type, callback) {
internals.Table.prototype.count = function (criteria, callback) {
this._run(this._table[type === 'fields' ? 'hasFields' : 'filter'](criteria).count(), 'count', { criteria: criteria, type: type }, callback);
this._run(internals.wrap(criteria).select(this._table).count(), 'count', { criteria: criteria }, callback);
};

@@ -303,1 +303,24 @@

};
exports.Criteria = internals.Criteria = function (criteria, type) {
this.criteria = criteria;
this.type = type || 'filter';
};
internals.Criteria.prototype.select = function (table) {
return table[this.type === 'fields' ? 'hasFields' : 'filter'](this.criteria);
};
internals.wrap = function (criteria) {
if (criteria instanceof internals.Criteria) {
return criteria;
}
return new internals.Criteria(criteria);
};

2

package.json
{
"name": "penseur",
"description": "Lightweight RethinkDB wrapper",
"version": "1.5.2",
"version": "2.0.0",
"author": "Eran Hammer <eran@hammer.io> (http://hueniverse.com)",

@@ -6,0 +6,0 @@ "repository": "git://github.com/hueniverse/penseur",

@@ -219,3 +219,3 @@ // Load modules

db.test.count({ a: 1 }, 'filter', function (err, result) {
db.test.count({ a: 1 }, function (err, result) {

@@ -240,3 +240,3 @@ expect(err).to.not.exist();

db.test.count(['a'], 'fields', function (err, result) {
db.test.count(db.fields(['a']), function (err, result) {

@@ -564,3 +564,3 @@ expect(err).to.not.exist();

db.test.count({ a: 1 }, 'filter', function (err, count) {
db.test.count({ a: 1 }, function (err, count) {

@@ -590,3 +590,3 @@ expect(err).to.not.exist();

db.test.count({ a: 1 }, 'filter', function (err, count) {
db.test.count({ a: 1 }, function (err, count) {

@@ -593,0 +593,0 @@ expect(err).to.not.exist();

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