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

amqplib-easy

Package Overview
Dependencies
Maintainers
30
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

amqplib-easy - npm Package Compare versions

Comparing version 4.3.0 to 4.3.1

12

index.js

@@ -104,9 +104,9 @@ 'use strict'

.then(function () {
if ((options.topics && options.topics.length) || (options.exchangeType === 'x-delayed-message' && options.exchangeOptions.arguments['x-delayed-type'] === 'topic')) {
return Promise.map(options.topics, function (topic) {
return ch.bindQueue(options.queue, options.exchange, topic, options.arguments)
})
} else if (options.exchangeType === 'fanout' || (options.exchangeType === 'x-delayed-message' && options.exchangeOptions.arguments['x-delayed-type'] === 'fanout')) {
return ch.bindQueue(options.queue, options.exchange, '', options.arguments)
if (!options.topics || !options.topics.length) {
options.topics = ['']
}
return Promise.map(options.topics, function (topic) {
return ch.bindQueue(options.queue, options.exchange, topic, options.arguments || {})
})
})

@@ -113,0 +113,0 @@ .then(function () {

{
"name": "amqplib-easy",
"version": "4.3.0",
"version": "4.3.1",
"description": "Simplified API for interacting with AMQP",

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

@@ -1,2 +0,2 @@

/*globals it:false*/
/* globals it:false */
'use strict'

@@ -202,2 +202,55 @@

})
describe('headers exchange', function () {
function deleteCat () {
return amqp.connect()
.then(function (connection) {
return connection.createChannel()
.then(function (channel) {
return channel.checkExchange('cat')
.then(
function () {
return channel.deleteExchange('cat')
},
function () { /* NBD it doesn't exist */
}
)
})
})
}
afterEach(deleteCat)
it('should publish via headers', function (done) {
amqp.consume(
{
exchange: 'cat',
exchangeType: 'headers',
arguments: {
'color': 'blue'
},
queue: 'found_cats'
},
function (cat) {
var name = cat.json.name
try {
name.should.equal('Sally')
done()
} catch (err) {
done(err)
}
}
)
.then(function (c) {
cancel = c
return amqp.publish(
{exchange: 'cat', exchangeType: 'headers'},
'found.tawny',
{name: 'Sally'},
{headers: {color: 'blue'}}
)
})
.catch(done)
})
})
})

@@ -204,0 +257,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