diff --git a/src/server/helpers/utils.js b/src/server/helpers/utils.js index 42dde25858..98545ba66a 100644 --- a/src/server/helpers/utils.js +++ b/src/server/helpers/utils.js @@ -43,7 +43,7 @@ module.exports.getURLBuilder = (options) => { * * @param {string} path the tail path of the url * @param {boolean} isExternal if the url is for the external world - * @param {boolean=} excludeHost if the server domain and protocol should be included + * @param {boolean} [excludeHost] if the server domain and protocol should be included */ const buildURL = (path, isExternal, excludeHost) => { let url = path diff --git a/src/server/logger.js b/src/server/logger.js index d7bb051537..3875190e18 100644 --- a/src/server/logger.js +++ b/src/server/logger.js @@ -39,8 +39,8 @@ function maskMessage (msg) { * @param {string | Error} arg the message or error to log * @param {string} tag a unique tag to easily search for this message * @param {string} level error | info | debug - * @param {string=} id a unique id to easily trace logs tied to a request - * @param {Function=} color function to display the log in appropriate color + * @param {string} [id] a unique id to easily trace logs tied to a request + * @param {Function} [color] function to display the log in appropriate color */ const log = (arg, tag = '', level, id = '', color = (message) => message) => { const time = new Date().toISOString() @@ -66,8 +66,8 @@ const log = (arg, tag = '', level, id = '', color = (message) => message) => { * INFO level log * * @param {string} msg the message to log - * @param {string=} tag a unique tag to easily search for this message - * @param {string=} traceId a unique id to easily trace logs tied to a request + * @param {string} [tag] a unique tag to easily search for this message + * @param {string} [traceId] a unique id to easily trace logs tied to a request */ exports.info = (msg, tag, traceId) => { log(msg, tag, 'info', traceId) @@ -77,8 +77,8 @@ exports.info = (msg, tag, traceId) => { * WARN level log * * @param {string} msg the message to log - * @param {string=} tag a unique tag to easily search for this message - * @param {string=} traceId a unique id to easily trace logs tied to a request + * @param {string} [tag] a unique tag to easily search for this message + * @param {string} [traceId] a unique id to easily trace logs tied to a request */ exports.warn = (msg, tag, traceId) => { // @ts-ignore @@ -89,8 +89,8 @@ exports.warn = (msg, tag, traceId) => { * ERROR level log * * @param {string | Error} msg the message to log - * @param {string=} tag a unique tag to easily search for this message - * @param {string=} traceId a unique id to easily trace logs tied to a request + * @param {string} [tag] a unique tag to easily search for this message + * @param {string} [traceId] a unique id to easily trace logs tied to a request */ exports.error = (msg, tag, traceId) => { // @ts-ignore @@ -101,8 +101,8 @@ exports.error = (msg, tag, traceId) => { * DEBUG level log * * @param {string} msg the message to log - * @param {string=} tag a unique tag to easily search for this message - * @param {string=} traceId a unique id to easily trace logs tied to a request + * @param {string} [tag] a unique tag to easily search for this message + * @param {string} [traceId] a unique id to easily trace logs tied to a request */ exports.debug = (msg, tag, traceId) => { if (process.env.NODE_ENV !== 'production') { diff --git a/src/server/provider/box/index.js b/src/server/provider/box/index.js index 9023f7551f..532ea1323e 100644 --- a/src/server/provider/box/index.js +++ b/src/server/provider/box/index.js @@ -41,6 +41,10 @@ class Box extends Provider { * Lists files and folders from Box API * * @param {object} options + * @param {string} options.directory + * @param {any} options.query + * @param {string} options.token + * @param {unknown} options.companion * @param {Function} done */ _list ({ directory, token, query, companion }, done) { diff --git a/src/server/provider/onedrive/index.js b/src/server/provider/onedrive/index.js index b7ee7a62ae..23ffeb7b0c 100644 --- a/src/server/provider/onedrive/index.js +++ b/src/server/provider/onedrive/index.js @@ -37,6 +37,9 @@ class OneDrive extends Provider { * it then waits till both requests are done before proceeding with the callback * * @param {object} options + * @param {string} options.directory + * @param {any} options.query + * @param {string} options.token * @param {Function} done */ _list ({ directory, query, token }, done) { diff --git a/src/server/provider/unsplash/adapter.js b/src/server/provider/unsplash/adapter.js index 9735b0c1c0..3fb9bcec91 100644 --- a/src/server/provider/unsplash/adapter.js +++ b/src/server/provider/unsplash/adapter.js @@ -40,7 +40,7 @@ exports.getItemThumbnailUrl = (item) => { } exports.getNextPageQuery = (currentQuery) => { - const newCursor = parseInt(currentQuery.cursor || 1) + 1 + const newCursor = Number.parseInt(currentQuery.cursor || 1, 10) + 1 const query = { ...currentQuery, cursor: newCursor, diff --git a/src/server/redis.js b/src/server/redis.js index 7edde33709..4e2bf6c11d 100644 --- a/src/server/redis.js +++ b/src/server/redis.js @@ -7,7 +7,7 @@ let redisClient * A Singleton module that provides a single redis client through out * the lifetime of the server * - * @param {object=} opts node-redis client options + * @param {Record} [opts] node-redis client options */ function createClient (opts) { if (!redisClient) {