From f98405bb15b8c9a5707e773989d72e29a0e2b35c Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Fri, 9 Oct 2020 14:45:17 +0000 Subject: [PATCH] Format code with prettier This commit fixes the style issues introduced in 2e49c66 according to the output from prettier. Details: https://deepsource.io/gh/MillenniumEarl/F95API/transform/74b785b0-6043-432a-9c60-d6a61bc39153/ --- app/scripts/urls-helper.js | 46 +++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/app/scripts/urls-helper.js b/app/scripts/urls-helper.js index 1c71701..577d892 100644 --- a/app/scripts/urls-helper.js +++ b/app/scripts/urls-helper.js @@ -2,7 +2,7 @@ // Public modules from npm const ky = require("ky-universal").create({ - throwHttpErrors: false + throwHttpErrors: false, }); // Modules from file @@ -25,14 +25,14 @@ module.exports.isF95URL = function (url) { * @param {String} url String to check for correctness * @returns {Boolean} true if the string is a valid URL, false otherwise */ -module.exports.isStringAValidURL = function(url) { - try { - new URL(url); - return true; - } catch (err) { - return false; - } -} +module.exports.isStringAValidURL = function (url) { + try { + new URL(url); + return true; + } catch (err) { + return false; + } +}; /** * @public @@ -41,20 +41,20 @@ module.exports.isStringAValidURL = function(url) { * @param {Boolean} checkRedirect If true, the function will consider redirects a violation and return false * @returns {Promise} true if the URL exists, false otherwise */ -module.exports.urlExists = async function(url, checkRedirect) { - if (!this.isStringAValidURL(url)) { - return false - } +module.exports.urlExists = async function (url, checkRedirect) { + if (!this.isStringAValidURL(url)) { + return false; + } - const response = await ky.head(url); - let valid = response !== undefined && !/4\d\d/.test(response.status); + const response = await ky.head(url); + let valid = response !== undefined && !/4\d\d/.test(response.status); - if(!valid) return false; + if (!valid) return false; - if(checkRedirect) { - if (response.url === url) valid = true; - else valid = false; - } - - return valid; -} + if (checkRedirect) { + if (response.url === url) valid = true; + else valid = false; + } + + return valid; +};