From 739a378ad59eae303531f29e4e7aa6d9acacca07 Mon Sep 17 00:00:00 2001 From: Saneef Ansari Date: Sat, 2 Dec 2023 12:41:35 +0530 Subject: [PATCH] Lints JS files --- lib/utils/file.js | 6 +++--- lib/utils/image.js | 8 ++++---- lib/utils/number.js | 4 ++-- lib/utils/url.js | 7 ++++--- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/lib/utils/file.js b/lib/utils/file.js index bef1808..fae4e9b 100644 --- a/lib/utils/file.js +++ b/lib/utils/file.js @@ -3,9 +3,9 @@ /** * Checks if the file path matches a whitelist of extensions * - * @param {string} path The path - * @param {Array} extensions The extensions - * @return {boolean} `True` if matches, `False` otherwise. + * @param {string} path The path + * @param {string[]} extensions The extensions + * @returns {boolean} `True` if matches, `False` otherwise. */ function isAllowedExtension(path, extensions) { const lowerCaseExtensions = extensions.map((x) => x.toLowerCase()); diff --git a/lib/utils/image.js b/lib/utils/image.js index abbd1bb..e7a63c9 100644 --- a/lib/utils/image.js +++ b/lib/utils/image.js @@ -3,10 +3,10 @@ /** * Generate Widths for Image * - * @param {number} min The minimum - * @param {number} max The maximum - * @param {number} step The step - * @return {Array} Widths + * @param {number} min The minimum + * @param {number} max The maximum + * @param {number} step The step + * @returns {number[]} Widths */ function generateWidths(min, max, step) { const sizes = []; diff --git a/lib/utils/number.js b/lib/utils/number.js index 9927f74..6a852d3 100644 --- a/lib/utils/number.js +++ b/lib/utils/number.js @@ -3,8 +3,8 @@ /** * Parse string with comma separated numbers into array of numbers * - * @param {string} str The string to parse - * @return {Array} An array of numbers + * @param {string} str The string to parse + * @returns {number[]} An array of numbers */ function parseStringToNumbers(str) { return str.split(",").map((s) => Number(s)); diff --git a/lib/utils/url.js b/lib/utils/url.js index 40e80ce..e9cba49 100644 --- a/lib/utils/url.js +++ b/lib/utils/url.js @@ -3,10 +3,11 @@ /** * Determines whether the specified string is an HTTP(S) URL. * - * @param {string} url The string - * @return {boolean} `True` if the specified path is an URL. + * @param {string} url The string + * @returns {boolean} `True` if the specified path is an URL. * - * Code from https://github.com/11ty/eleventy-img/blob/a2eb5d0e0e4cf3ce2dd330a7ac09ece676bfb7cd/img.js + * Code from + * https://github.com/11ty/eleventy-img/blob/a2eb5d0e0e4cf3ce2dd330a7ac09ece676bfb7cd/img.js */ function isRemoteUrl(url) { try {