Updating postal.channel to allow for string topic args only

This commit is contained in:
Jim Cowart 2012-03-20 02:35:11 -04:00
parent b48bdfc276
commit 829d5504ba

View file

@ -20,8 +20,9 @@ var postal = {
},
channel: function(options) {
var channel = options.channel || DEFAULT_CHANNEL,
tpc = options.topic;
var channel, tpc;
tpc = (Object.prototype.toString.call(options) === "[object String]") ? options : options.topic;
channel = options.channel || DEFAULT_CHANNEL;
return new ChannelDefinition(channel, tpc);
},