aboutsummaryrefslogtreecommitdiffstats
path: root/lib/util.js
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@redhat.com>2011-04-28 13:28:55 +0200
committerMatěj Cepl <mcepl@redhat.com>2011-06-05 14:47:40 +0200
commit55d9a312fbba91f1bcf5e3f3291b7bece8abb178 (patch)
treebb9ef165b425273da47aa000268395f87f26678e /lib/util.js
parent34bbe8e7306a0d0ec014db7512788ed92c625d19 (diff)
downloadbugzilla-triage-55d9a312fbba91f1bcf5e3f3291b7bece8abb178.tar.gz
Reformatting to MoFo coding style
Diffstat (limited to 'lib/util.js')
-rw-r--r--lib/util.js31
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;
};