New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

sharedb

Package Overview
Dependencies
Maintainers
1
Versions
141
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sharedb - npm Package Compare versions

Comparing version 0.11.5 to 0.11.6

20

lib/backend.js

@@ -35,8 +35,20 @@ var async = require('async');

Backend.prototype.close = function() {
this.pubsub.close();
this.db.close();
Backend.prototype.close = function(callback) {
var wait = 3;
var backend = this;
function finish(err) {
if (err) {
if (callback) return callback(err);
return backend.emit('error', err);
}
if (--wait) return;
if (callback) callback();
}
this.pubsub.close(finish);
this.db.close(finish);
for (var name in this.extraDbs) {
this.extraDbs[name].close();
wait++;
this.extraDbs[name].close(finish);
}
finish();
};

@@ -43,0 +55,0 @@

4

lib/db/index.js

@@ -12,3 +12,5 @@ var async = require('async');

DB.prototype.close = function() {};
DB.prototype.close = function(callback) {
if (callback) callback();
};

@@ -15,0 +17,0 @@ DB.prototype.commit = function(collection, id, op, snapshot, callback) {

{
"name": "sharedb",
"version": "0.11.5",
"version": "0.11.6",
"description": "JSON OT database backend",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -6,3 +6,3 @@ var expect = require('expect.js');

describe('DB base class', function() {
it('can call db.close()', function() {
it('can call db.close() without callback', function() {
var db = new DB();

@@ -12,2 +12,7 @@ db.close();

it('can call db.close() with callback', function(done) {
var db = new DB();
db.close(done);
});
it('returns an error if db.commit() is unimplemented', function(done) {

@@ -14,0 +19,0 @@ var db = new DB();

@@ -18,6 +18,14 @@ var async = require('async');

afterEach(function() {
this.backend.close();
afterEach(function(done) {
this.backend.close(done);
});
it('can call db.close() without callback', function(done) {
create(function(err, db) {
if (err) return done(err);
db.close();
done();
});
});
require('./client/projections')();

@@ -24,0 +32,0 @@ require('./client/query-subscribe')();

@@ -18,2 +18,10 @@ var expect = require('expect.js');

it('can call pubsub.close() without callback', function(done) {
create(function(err, pubsub) {
if (err) done(err);
pubsub.close();
done();
});
});
it('can subscribe to a channel', function(done) {

@@ -20,0 +28,0 @@ var pubsub = this.pubsub;

Sorry, the diff of this file is not supported yet

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