Users of Amqp-0-9-1.js cannot use the default exchange or empty-string routing keys.
This is because the guards are too strict. For example in publishBasic(...):
if(!exchange||typeofexchange!='string'){thrownewError("AmqpChannel.publishBasic(): String parameter \'exchange\' is required");}if(!routingKey||typeofroutingKey!='string'){thrownewError("AmqpChannel.publishBasic(): String parameter \'routingKey\' is required");}They are too strict because the empty-string '' is a falsy value in JavaScript (see: https://developer.mozilla.org/en-US/docs/Glossary/Falsy)
I would suggest changing guards, where the empty-string should be allowed, to something like the following:
if(exchange==null||exchange==undefined||typeofexchange!='string'){thrownewError("AmqpChannel.publishBasic(): String parameter \'exchange\' is required");}if(routingKey==null||routingKey==undefined||typeofroutingKey!='string'){thrownewError("AmqpChannel.publishBasic(): String parameter \'routingKey\' is required");}
Users of
Amqp-0-9-1.jscannot use the default exchange or empty-string routing keys.This is because the guards are too strict. For example in
publishBasic(...):They are too strict because the empty-string
''is a falsy value in JavaScript (see: https://developer.mozilla.org/en-US/docs/Glossary/Falsy)I would suggest changing guards, where the empty-string should be allowed, to something like the following: