Skip to content

Commit

Permalink
@uppy/companion: fix some linter warnings (transloadit#3752)
Browse files Browse the repository at this point in the history
  • Loading branch information
aduh95 authored May 26, 2022
1 parent 3387b84 commit 4374cda
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/server/helpers/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 10 additions & 10 deletions src/server/logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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)
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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') {
Expand Down
4 changes: 4 additions & 0 deletions src/server/provider/box/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
3 changes: 3 additions & 0 deletions src/server/provider/onedrive/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/server/provider/unsplash/adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/server/redis.js
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, unknown>} [opts] node-redis client options
*/
function createClient (opts) {
if (!redisClient) {
Expand Down

0 comments on commit 4374cda

Please sign in to comment.