From b4d81bd1246e780172b2c5685d6717129fd8f68e Mon Sep 17 00:00:00 2001 From: mzabriskie Date: Fri, 23 Jan 2015 02:12:28 -0700 Subject: [PATCH] Adding comments --- lib/helpers/buildUrl.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/helpers/buildUrl.js b/lib/helpers/buildUrl.js index 97fdb69..f624cbe 100644 --- a/lib/helpers/buildUrl.js +++ b/lib/helpers/buildUrl.js @@ -11,6 +11,13 @@ function encode(val) { replace(/%20/g, '+'); } +/** + * Build a URL by appending params to the end + * + * @param {string} url The base of the url (e.g., http://www.google.com) + * @param {object} [params] The params to be appended + * @returns {string} The formatted url + */ module.exports = function buildUrl(url, params) { if (!params) { return url; @@ -42,4 +49,4 @@ module.exports = function buildUrl(url, params) { } return url; -}; \ No newline at end of file +};