From 829d5504badf0cc80b9f6392c1674b665cd756e2 Mon Sep 17 00:00:00 2001 From: Jim Cowart Date: Tue, 20 Mar 2012 02:35:11 -0400 Subject: [PATCH] Updating postal.channel to allow for string topic args only --- src/main/Api.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/Api.js b/src/main/Api.js index ed4819a..b68e3e1 100644 --- a/src/main/Api.js +++ b/src/main/Api.js @@ -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); },