diff options
author | Matěj Cepl <mcepl@redhat.com> | 2011-04-28 13:28:55 +0200 |
---|---|---|
committer | Matěj Cepl <mcepl@redhat.com> | 2011-04-28 18:26:14 +0200 |
commit | 32af48e442a960b8c3f199f5ffad28a34590fcda (patch) | |
tree | c291cb97627bd2cfb65167347261d5ef8f521bfd /lib/util.js | |
parent | 2382ba19afc84e9b747a7981ebf72aaa704f08b6 (diff) | |
download | bugzilla-triage-32af48e442a960b8c3f199f5ffad28a34590fcda.tar.gz |
Reformatting to MoFo coding style
Diffstat (limited to 'lib/util.js')
-rw-r--r-- | lib/util.js | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/lib/util.js b/lib/util.js index d28f001..008d6fb 100644 --- a/lib/util.js +++ b/lib/util.js @@ -11,7 +11,7 @@ var urlMod = require("url"); /** * get parameters of URL as an object (name, value) */ -function getParamsFromURL (url, base) { +function getParamsFromURL(url, base) { if (!url || (url.toString().length === 0)) { throw new Error("Missing URL value!"); } @@ -23,7 +23,7 @@ function getParamsFromURL (url, base) { var paramsArr = url.path.split("?"); if (paramsArr.length === 1) { return {}; - } + } // get convert URL parameters to an Object var params = {}, s = []; @@ -35,11 +35,11 @@ function getParamsFromURL (url, base) { } /** - * Get a bug no from URL ... fails with aliases - * It should theoretically belong to bzpage.js, but we don't have - * unit tests there yet, so keeping here. - * - * @param url String with URL to be analyzed + * Get a bug no from URL ... fails with aliases It should theoretically belong + * to bzpage.js, but we don't have unit tests there yet, so keeping here. + * + * @param url + * String with URL to be analyzed * @return String with the bug ID (hopefully number, but not for aliases) */ exports.getBugNo = function getBugNo(url) { @@ -51,7 +51,7 @@ exports.getBugNo = function getBugNo(url) { /** * format date to be in ISO format (just day part) - * + * * @param date * @return string with the formatted date */ @@ -60,18 +60,15 @@ exports.getISODate = function getISODate(dateStr) { return n < 10 ? '0' + n : n; } var date = new Date(dateStr); - return date.getFullYear() + '-' + pad(date.getMonth() + 1) + '-' + - pad(date.getDate()); + return date.getFullYear() + '-' + pad(date.getMonth() + 1) + + '-' + pad(date.getDate()); }; /** - * object to pack messaging. Use as in - postMessage(new Message("GetPassword", { - login: login, - hostname: location.hostname - })); + * object to pack messaging. Use as in postMessage(new Message("GetPassword", { + * login: login, hostname: location.hostname })); */ exports.Message = function Message(cmd, data) { - this.cmd = cmd; - this.data = data; + this.cmd = cmd; + this.data = data; }; |