From 32af48e442a960b8c3f199f5ffad28a34590fcda Mon Sep 17 00:00:00 2001 From: Matěj Cepl Date: Thu, 28 Apr 2011 13:28:55 +0200 Subject: Reformatting to MoFo coding style --- lib/util.js | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) (limited to 'lib/util.js') 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; }; -- cgit