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 6.2.0 to 6.3.0

9

lib/table.js

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

exist(id, callback) {
if (id.toString().length > 127) {
return this._error('exist', 'Invalid id length', id, Hoek.nextTick(callback));
}
this._run(this._table.get(id).ne(null), 'exist', id, callback);
}
query(criteria, options, callback) {

@@ -65,0 +74,0 @@

2

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

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

@@ -39,17 +39,2 @@ 'use strict';

it('fails on database error', (done) => {
const db = new Penseur.Db('penseurtest');
db.table('invalid');
db.connect((err) => {
expect(err).to.not.exist();
db.invalid.get(1, (err, item) => {
expect(err).to.exist();
done();
});
});
});
it('returns the requested objects', (done) => {

@@ -75,2 +60,17 @@

it('fails on database error', (done) => {
const db = new Penseur.Db('penseurtest');
db.table('invalid');
db.connect((err) => {
expect(err).to.not.exist();
db.invalid.get(1, (err, item) => {
expect(err).to.exist();
done();
});
});
});
it('returns the requested objects (array of one)', (done) => {

@@ -197,2 +197,55 @@

describe('exist()', () => {
it('checks if record exists', (done) => {
const db = new Penseur.Db('penseurtest');
db.establish(['test'], (err) => {
expect(err).to.not.exist();
db.test.insert({ id: 1, a: 1 }, (err, keys) => {
expect(err).to.not.exist();
db.test.exist(1, (err, exists) => {
expect(err).to.not.exist();
expect(exists).to.be.true();
done();
});
});
});
});
it('checks if record does not exists', (done) => {
const db = new Penseur.Db('penseurtest');
db.establish(['test'], (err) => {
expect(err).to.not.exist();
db.test.exist(1, (err, exists) => {
expect(err).to.not.exist();
expect(exists).to.be.false();
done();
});
});
});
it('errors on invalid id', (done) => {
const db = new Penseur.Db('penseurtest');
db.establish(['test'], (err) => {
expect(err).to.not.exist();
db.test.exist('0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789', (err, result) => {
expect(err).to.exist();
done();
});
});
});
});
describe('query()', () => {

@@ -199,0 +252,0 @@

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