From ecac786da7f93d817eadc01ab479bfe7b3719f79 Mon Sep 17 00:00:00 2001 From: 0-harshit-0 Date: Fri, 14 Jul 2023 18:39:12 +0530 Subject: [PATCH] Remove URL validation (#1335) * Update ValidateUrl.js Used JS URL API to check if URL is valid. If valid it will return the url else false; * Update ValidateUrl.js Fixed for #1183 * Update ValidateUrl.js fixed code style test. Fixed for #1183 * Delete ValidateUrl.js Fixes: #1183 --- String/ValidateUrl.js | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 String/ValidateUrl.js diff --git a/String/ValidateUrl.js b/String/ValidateUrl.js deleted file mode 100644 index cfcbd4366..000000000 --- a/String/ValidateUrl.js +++ /dev/null @@ -1,13 +0,0 @@ -/** - * @function ValidateURL - * @description validate the URL. - * @param {String} url - The input URL string - * @return {Boolean} - */ -const validateURL = (url) => { - const URL_PATTERN = /^(https?:\/\/(?:www\.|(?!www))[^\s.]+\.[^\s]{2,}|www\.[^\s]+\.[^\s]{2,})$/gi - - return URL_PATTERN.test(url) -} - -export { validateURL }