From eee64c8064c2bbf7bd5cd2de8a5fda5daab17fec Mon Sep 17 00:00:00 2001 From: rejas Date: Wed, 29 Jul 2020 22:13:19 +0200 Subject: [PATCH] Cleanup clientonly jsdoc --- clientonly/index.js | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/clientonly/index.js b/clientonly/index.js index e42aa186..bfde722e 100644 --- a/clientonly/index.js +++ b/clientonly/index.js @@ -9,11 +9,13 @@ */ function getServerAddress() { /** - * Helper function to get command line parameters + * Get command line parameters * Assumes that a cmdline parameter is defined with `--key [value]` * - * @param key - * @param defaultValue + * @param {string} key key to look for at the command line + * @param {string} defaultValue value if no key is given at the command line + * + * @returns {string} the value of the parameter */ function getCommandLineParameter(key, defaultValue = undefined) { var index = process.argv.indexOf(`--${key}`); @@ -31,12 +33,15 @@ } /** - * @param url + * Gets the config from the specified server url + * + * @param {string} url location where the server is running + * @returns {Promise} the config */ function getServerConfig(url) { // Return new pending promise return new Promise((resolve, reject) => { - // Select http or https module, depending on reqested url + // Select http or https module, depending on requested url const lib = url.startsWith("https") ? require("https") : require("http"); const request = lib.get(url, (response) => { var configData = ""; @@ -58,8 +63,10 @@ } /** - * @param message - * @param code + * Print a message to the console in case of errors + * + * @param {string} [message] error message to print + * @param {number} code error code for the exit call */ function fail(message, code = 1) { if (message !== undefined && typeof message === "string") {