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 7.14.0 to 7.15.0

23

lib/criteria.js

@@ -34,2 +34,11 @@ 'use strict';

internals.empty = function (path) {
const selector = path.reduce((memo, next) => memo(next), exports.row);
return RethinkDB.branch(
selector.typeOf().eq('ARRAY'), selector.isEmpty(),
selector.typeOf().eq('OBJECT'), selector.keys().isEmpty(),
false);
};
internals.compile = function (criteria, relative) {

@@ -63,5 +72,4 @@

// Special rule
Hoek.assert(['contains', 'is', 'not', 'or', 'unset', 'empty'].indexOf(value.type) !== -1, `Unknown criteria value type ${value.type}`);
Hoek.assert(['contains', 'is', 'not', 'or', 'unset'].indexOf(value.type) !== -1, `Unknown criteria value type ${value.type}`);
if (value.type === 'contains') {

@@ -97,6 +105,9 @@

if (typeof orValue === 'function') {
Hoek.assert(['unset', 'is'].indexOf(orValue.type) !== -1, `Unknown or criteria value type ${orValue.type}`);
Hoek.assert(['unset', 'is', 'empty'].indexOf(orValue.type) !== -1, `Unknown or criteria value type ${orValue.type}`);
if (orValue.type === 'unset') {
ors.push(exports.row(path.slice(0, -1)).hasFields(path[path.length - 1]).not());
}
else if (orValue.type === 'empty') {
ors.push(internals.empty(path));
}
else {

@@ -127,2 +138,8 @@ ors.push(internals.toComparator(row, orValue));

}
else if (value.type === 'empty') {
// empty
tests.push(internals.empty(path));
}
else {

@@ -129,0 +146,0 @@

@@ -648,2 +648,7 @@ 'use strict';

static empty() {
return internals.special('empty');
}
// Criteria or Modifier

@@ -679,2 +684,3 @@

internals.Db.prototype.unset = internals.Db.unset;
internals.Db.prototype.empty = internals.Db.empty;
internals.Db.prototype.increment = internals.Db.increment;

@@ -681,0 +687,0 @@ internals.Db.prototype.append = internals.Db.append;

2

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

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

@@ -210,2 +210,3 @@ # penseur

#### `Db.unset()`
#### `Db.empty()`
#### `Db.increment(value)`

@@ -212,0 +213,0 @@ #### `Db.append(value[, options])`

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