Skip to content

Commit

Permalink
Lints JS files
Browse files Browse the repository at this point in the history
  • Loading branch information
saneef committed Dec 2, 2023
1 parent 8c94ae9 commit e2b209f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
6 changes: 3 additions & 3 deletions lib/utils/file.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
/**
* Checks if the file path matches a whitelist of extensions
*
* @param {string} path The path
* @param {Array<string>} 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());
Expand Down
8 changes: 4 additions & 4 deletions lib/utils/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -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<number>} 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 = [];
Expand Down
4 changes: 2 additions & 2 deletions lib/utils/number.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
/**
* Parse string with comma separated numbers into array of numbers
*
* @param {string} str The string to parse
* @return {Array<number>} 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));
Expand Down
7 changes: 4 additions & 3 deletions lib/utils/url.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit e2b209f

Please sign in to comment.