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

zookeeper-hd

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zookeeper-hd - npm Package Compare versions

Comparing version 0.3.1 to 0.3.2

coffee/test/integration/FakePlusClient.coffee

4

js/src/lib/FakeZookeeper.js

@@ -142,2 +142,6 @@ // This file has been generated from coffee source files

FakeZookeeper.prototype.connect = function(cb) {
return cb();
};
FakeZookeeper.prototype._stat = function(node) {

@@ -144,0 +148,0 @@ return {

// This file has been generated from coffee source files
var PlusClient, SimpleClient, async, _;
var PlusClient, SimpleClient, async, path, _;

@@ -11,2 +11,4 @@ SimpleClient = require('./SimpleClient');

path = require('path');
module.exports = PlusClient = (function() {

@@ -22,2 +24,3 @@ function PlusClient(options) {

PlusClient.prototype.create = function(zkPath, value, options, onReady) {
var _this = this;
if (!onReady) {

@@ -33,5 +36,17 @@ onReady = options;

options = _.defaults(options, {
flags: null
flags: null,
createPathIfNotExists: false
});
return this.client.create(zkPath, value, options.flags, onReady);
return async.waterfall([
function(asyncReady) {
if (!options.createPathIfNotExists) {
return asyncReady();
}
return _this.createPathIfNotExists(path.dirname(zkPath), options, asyncReady);
}, function(asyncReady) {
return _this.client.create(zkPath, value, options.flags, asyncReady);
}
], function(err, path) {
return onReady(err, path);
});
};

@@ -165,2 +180,3 @@

PlusClient.prototype.set = function(zkPath, value, version, options, onReady) {
var _this = this;
if (!onReady) {

@@ -170,3 +186,17 @@ onReady = options;

}
return this.client.set(zkPath, value, version, onReady);
options = _.defaults(options, {
createPathIfNotExists: false
});
return async.waterfall([
function(asyncReady) {
if (!options.createPathIfNotExists) {
return asyncReady();
}
return _this.createPathIfNotExists(zkPath, options, asyncReady);
}, function(asyncReady) {
return _this.client.set(zkPath, value, version, asyncReady);
}
], function(err, stat) {
return onReady(err, stat);
});
};

@@ -173,0 +203,0 @@

@@ -19,2 +19,5 @@ // This file has been generated from coffee source files

}
if (arguments.length <= 3) {
return onData(null, data1);
}
return onData(null, data1, data2);

@@ -21,0 +24,0 @@ };

2

js/test/unit/PlusClient.js

@@ -21,3 +21,3 @@ // This file has been generated from coffee source files

});
mockery.registerAllowables(['../../src/lib/PlusClient', 'async', 'underscore']);
mockery.registerAllowables(['../../src/lib/PlusClient', 'async', 'underscore', 'path']);
mockery.registerMock('./SimpleClient', SimpleClientStub);

@@ -24,0 +24,0 @@ return PlusClient = require('../../src/lib/PlusClient');

{
"name": "zookeeper-hd",
"version": "0.3.1",
"version": "0.3.2",
"description": "Higher level (normalized) zookeeper client",

@@ -5,0 +5,0 @@ "author": "Hans Donner",

@@ -59,2 +59,5 @@ zookeeper-hd

See [coffeescript | js]/test/integration/FakePlusClient for an example where only the original zookeeper
module is changed (using mockery), and the PlusClient is used to perform zookeeper actions
Various

@@ -61,0 +64,0 @@ -------

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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