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

larvitamintercom

Package Overview
Dependencies
Maintainers
2
Versions
142
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

larvitamintercom - npm Package Compare versions

Comparing version

to
0.2.1

30

index.js

@@ -11,3 +11,4 @@ 'use strict';

url = require('url'),
net = require('net');
net = require('net'),
_ = require('lodash');

@@ -678,2 +679,3 @@ /**

* 'forceConsumeQueue': boolean, // Default: false - will create a consume-queue even if there currently are no listeners
* 'ignoreConQueue': boolean, // Default: undefined - will ignore the consume queue for loopback interfaces
* }

@@ -688,4 +690,5 @@ * @param func cb(err, message assigned uuid)

let cbsRan = 0,
cbErr,
stringifiedMsg;
stringifiedMsg,
msgUuid,
cbErr;

@@ -705,7 +708,9 @@ if (typeof options === 'function') {

if (message.uuid === undefined) {
message.uuid = uuidLib.v4();
}
msgUuid = message.uuid;
try {
if (message.uuid === undefined) {
message.uuid = uuidLib.v4();
}
stringifiedMsg = JSON.stringify(message);

@@ -726,2 +731,4 @@ } catch (err) {

) {
const newOrgMsg = _.cloneDeep(orgMsg);
if (that.loopbackConQueue[options.exchange] === undefined) {

@@ -731,8 +738,11 @@ that.loopbackConQueue[options.exchange] = [];

that.loopbackConQueue[options.exchange].push({'orgMsg': orgMsg, 'options': options});
return cb();
newOrgMsg.uuid = msgUuid;
that.loopbackConQueue[options.exchange].push({'orgMsg': newOrgMsg, 'options': options});
return cb(null, msgUuid);
}
that.emit('incoming_msg_' + options.exchange, message, uuidLib.v4());
return cb();
return cb(null, msgUuid);
}

@@ -739,0 +749,0 @@

{
"name": "larvitamintercom",
"version": "0.2.0",
"version": "0.2.1",
"description": "",

@@ -30,2 +30,3 @@ "main": "index.js",

"larvitutils": "^1.1.0",
"lodash": "^4.17.4",
"uuid": "^3.0.0",

@@ -32,0 +33,0 @@ "winston": "^2.2.0"

@@ -474,3 +474,5 @@ 'use strict';

intercom.send(orgMsg, function (err) {
intercom.send(orgMsg, function (err, msgUuid) {
assert.notStrictEqual(lUtils.formatUuid(msgUuid), false, 'msg.uuid must be a valid uuid');
if (err) throw err;

@@ -495,3 +497,5 @@ });

intercom.send(orgMsg, function (err) {
intercom.send(orgMsg, function (err, msgUuid) {
assert.notStrictEqual(lUtils.formatUuid(msgUuid), false, 'msg.uuid must be a valid uuid');
if (err) throw err;

@@ -523,3 +527,5 @@ });

intercom.send(orgMsg, {'exchange': exchange}, function (err) {
intercom.send(orgMsg, {'exchange': exchange}, function (err, msgUuid) {
assert.notStrictEqual(lUtils.formatUuid(msgUuid), false, 'msg.uuid must be a valid uuid');
if (err) throw err;

@@ -551,3 +557,5 @@ });

intercom.send(orgMsg, {'exchange': exchange}, function (err) {
intercom.send(orgMsg, {'exchange': exchange}, function (err, msgUuid) {
assert.notStrictEqual(lUtils.formatUuid(msgUuid), false, 'msg.uuid must be a valid uuid');
if (err) throw err;

@@ -585,7 +593,15 @@ });

tasks.push(function (cb) {
intercom.send(orgMsg1, {'exchange': exchange1}, cb);
intercom.send(orgMsg1, {'exchange': exchange1}, function (err, msgUuid) {
assert.notStrictEqual(lUtils.formatUuid(msgUuid), false, 'msg.uuid must be a valid uuid');
if (err) throw err;
cb(err);
});
});
tasks.push(function (cb) {
intercom.send(orgMsg2, {'exchange': exchange2}, cb);
intercom.send(orgMsg2, {'exchange': exchange2}, function (err, msgUuid) {
assert.notStrictEqual(lUtils.formatUuid(msgUuid), false, 'msg.uuid must be a valid uuid');
if (err) throw err;
cb(err);
});
});

@@ -607,3 +623,3 @@

it('send 1000 messages on subscription', function (done) {
it('send 100 messages on subscription', function (done) {
const intercom = new Intercom('loopback interface');

@@ -624,3 +640,3 @@

if (receivedMsgs === 1000) {
if (receivedMsgs === 100) {
assert.strictEqual(expectedSum, actualSum);

@@ -633,3 +649,3 @@ done();

for (let i = 0; i !== 1000; i ++) {
for (let i = 0; i !== 100; i ++) {
const thisNr = Math.round(Math.random());

@@ -639,3 +655,5 @@

intercom.send({'thisNr': thisNr}, function (err) {
intercom.send({'thisNr': thisNr}, function (err, msgUuid) {
assert.notStrictEqual(lUtils.formatUuid(msgUuid), false, 'msg.uuid must be a valid uuid');
if (err) throw err;

@@ -646,3 +664,3 @@ });

it('send 1000 messages on consume', function (done) {
it('send 100 messages on consume', function (done) {
const intercom = new Intercom('loopback interface');

@@ -663,3 +681,3 @@

if (receivedMsgs === 1000) {
if (receivedMsgs === 100) {
assert.strictEqual(expectedSum, actualSum);

@@ -672,3 +690,3 @@ done();

for (let i = 0; i !== 1000; i ++) {
for (let i = 0; i !== 100; i ++) {
const thisNr = Math.round(Math.random());

@@ -678,3 +696,5 @@

intercom.send({'thisNr': thisNr}, function (err) {
intercom.send({'thisNr': thisNr}, function (err, msgUuid) {
assert.notStrictEqual(lUtils.formatUuid(msgUuid), false, 'msg.uuid must be a valid uuid');
if (err) throw err;

@@ -681,0 +701,0 @@ });