diff --git a/js/node_helper.js b/js/node_helper.js index 45bd03dd..86ad3aa4 100644 --- a/js/node_helper.js +++ b/js/node_helper.js @@ -122,6 +122,13 @@ NodeHelper.checkFetchStatus = function (response) { } }; +/** + * Look at the specified error and return an appropriate error type, that + * can be translated to a detailed error message + * + * @param {Error} error the error from fetching something + * @returns {string} the string of the detailed error message in the translations + */ NodeHelper.checkFetchError = function (error) { let error_type = "MODULE_ERROR_UNSPECIFIED"; if (error.code === "EAI_AGAIN") { diff --git a/modules/default/alert/notificationFx.js b/modules/default/alert/notificationFx.js index 0aa2a5c3..317fa75a 100644 --- a/modules/default/alert/notificationFx.js +++ b/modules/default/alert/notificationFx.js @@ -123,7 +123,7 @@ /** * Dismiss the notification * - * @param close + * @param {boolean} [close] call the onClose callback at the end */ NotificationFx.prototype.dismiss = function (close = true) { this.active = false; diff --git a/modules/default/calendar/calendarutils.js b/modules/default/calendar/calendarutils.js index 223dfb26..7f0b14b8 100644 --- a/modules/default/calendar/calendarutils.js +++ b/modules/default/calendar/calendarutils.js @@ -18,8 +18,8 @@ const CalendarUtils = { * Calculate the time correction, either dst/std or full day in cases where * utc time is day before plus offset * - * @param {object} event - * @param {Date} date + * @param {object} event the event which needs adjustement + * @param {Date} date the date on which this event happens * @returns {number} the necessary adjustment in hours */ calculateTimezoneAdjustment: function (event, date) { @@ -117,6 +117,13 @@ const CalendarUtils = { return adjustHours; }, + /** + * Filter the events from ical according to the given config + * + * @param {object} data the calendar data from ical + * @param {object} config The configuration object + * @returns {string[]} the filtered events + */ filterEvents: function (data, config) { const newEvents = []; @@ -500,8 +507,8 @@ const CalendarUtils = { /** * Lookup iana tz from windows * - * @param msTZName - * @returns {*|null} + * @param {string} msTZName the timezone name to lookup + * @returns {string|null} the iana name or null of none is found */ getIanaTZFromMS: function (msTZName) { // Get hash entry @@ -571,12 +578,13 @@ const CalendarUtils = { }, /** + * Determines if the user defined title filter should apply * - * @param title - * @param filter - * @param useRegex - * @param regexFlags - * @returns {boolean|*} + * @param {string} title the title of the event + * @param {string} filter the string to look for, can be a regex also + * @param {boolean} useRegex true if a regex should be used, otherwise it just looks for the filter as a string + * @param {string} regexFlags flags that should be applied to the regex + * @returns {boolean} True if the title should be filtered out, false otherwise */ titleFilterApplies: function (title, filter, useRegex, regexFlags) { if (useRegex) { diff --git a/modules/default/compliments/compliments.js b/modules/default/compliments/compliments.js index fc90527f..054a409f 100644 --- a/modules/default/compliments/compliments.js +++ b/modules/default/compliments/compliments.js @@ -55,7 +55,7 @@ Module.register("compliments", { /** * Generate a random index for a list of compliments. * - * @param {string[]} compliments Array with compliments. + * @param {string[]} compliments Array with compliments. * @returns {number} a random index of given array */ randomIndex: function (compliments) { diff --git a/modules/default/newsfeed/node_helper.js b/modules/default/newsfeed/node_helper.js index 55f403db..32656a9f 100644 --- a/modules/default/newsfeed/node_helper.js +++ b/modules/default/newsfeed/node_helper.js @@ -27,8 +27,8 @@ module.exports = NodeHelper.create({ * Creates a fetcher for a new feed if it doesn't exist yet. * Otherwise it reuses the existing one. * - * @param {object} feed The feed object. - * @param {object} config The configuration object. + * @param {object} feed The feed object + * @param {object} config The configuration object */ createFetcher: function (feed, config) { const url = feed.url || "";