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.0.1 to 6.1.0

9

lib/table.js

@@ -110,4 +110,9 @@ 'use strict';

insert(items, callback) {
insert(items, options, callback) {
if (!callback) {
callback = options;
options = {};
}
Id.wrap(this, items, (err, wrapped) => {

@@ -125,3 +130,3 @@

this._run(this._table.insert(wrapped), 'insert', wrapped, callback, (ignore, result) => {
this._run(this._table.insert(wrapped, { conflict: options.merge ? 'update' : 'error' }), 'insert', wrapped, callback, (ignore, result) => {

@@ -128,0 +133,0 @@ // Single item

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

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

@@ -444,2 +444,31 @@ 'use strict';

it('updates a record if exists', (done) => {
const db = new Penseur.Db('penseurtest');
db.establish(['test'], (err) => {
expect(err).to.not.exist();
db.test.insert({ id: 1, a: 1, b: 1 }, { merge: true }, (err, keys1) => {
expect(err).to.not.exist();
db.test.get(1, (err, item1) => {
expect(err).to.not.exist();
expect(item1).to.equal({ id: 1, a: 1, b: 1 });
db.test.insert({ id: 1, a: 2 }, { merge: true }, (err, keys2) => {
expect(err).to.not.exist();
db.test.get(1, (err, item2) => {
expect(err).to.not.exist();
expect(item2).to.equal({ id: 1, a: 2, b: 1 });
done();
});
});
});
});
});
});
it('returns the generate key', (done) => {

@@ -446,0 +475,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