Socket
Socket
Sign inDemoInstall

couchdb-worker

Package Overview
Dependencies
48
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.4.1 to 0.4.2

9

lib/worker.js

@@ -12,3 +12,3 @@ /*

var request = require("request");
var extend = require("node.extend");
var _ = require("underscore");

@@ -225,3 +225,3 @@ module.exports = Worker;

extend(doc.worker_status[this.name], status);
_.extend(doc.worker_status[this.name], status);
};

@@ -300,5 +300,4 @@

// FIXME: do not overwrite nesteds!
// (write custom extend)
extend(doc, attributes);
// maybe FIXME (check if still valid): do not overwrite nesteds!
_.extend(doc, attributes);
};

@@ -305,0 +304,0 @@

@@ -9,7 +9,6 @@ {

},
"version": "0.4.1",
"version": "0.4.2",
"dependencies": {
"request": "*",
"underscore": "*",
"node.extend": ">=1.0.0"
"underscore": "*"
},

@@ -16,0 +15,0 @@ "devDependencies": {

@@ -130,33 +130,11 @@ /*

it("should insert status", function() {
var status = 'mystatus',
error = 'myerror',
var status = { foo: 'bar' },
doc = {};
worker._setWorkerStatus(doc, status, error);
worker._setWorkerStatus(doc, status);
assert.equal('object', typeof doc.worker_status);
assert.equal('object', typeof doc.worker_status[worker.name]);
assert.equal(status, doc.worker_status[worker.name].status);
assert.equal(error, doc.worker_status[worker.name].error);
assert.equal(status.foo, doc.worker_status[worker.name].foo);
});
it("should not insert error if error is null", function() {
var doc = {};
worker._setWorkerStatus(doc, 'mystatus', null);
assert(!('error' in doc.worker_status[worker.name]));
});
it("should insert additional status", function() {
var status = 'mystatus',
additionalStatus = {
foo: 'bar'
},
doc = {};
worker._setWorkerStatus(doc, status, null, additionalStatus);
assert.equal('object', typeof doc.worker_status);
assert.equal('object', typeof doc.worker_status[worker.name]);
assert.equal(additionalStatus.foo, doc.worker_status[worker.name].foo);
});
});

@@ -163,0 +141,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc