Skip to content

🔥 The free & Open Source DocuSign alternative

Replace npm package with manual valiadation

rishabjasrotia1b3508a9ef34
diff --git a/microfrontends/SignDocuments/package-lock.json b/microfrontends/SignDocuments/package-lock.json
index d087684f9..30f707e44 100644
--- a/microfrontends/SignDocuments/package-lock.json
+++ b/microfrontends/SignDocuments/package-lock.json
@@ -36,7 +36,6 @@
"react-scrollbars-custom": "^4.1.1",
"react-signature-canvas": "^1.0.6",
"reactour": "^1.19.1",
- "validator": "^13.11.0",
"web-vitals": "^2.1.4"
}
},
@@ -20503,14 +20502,6 @@
"resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz",
"integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A=="
},
- "node_modules/validator": {
- "version": "13.11.0",
- "resolved": "https://registry.npmjs.org/validator/-/validator-13.11.0.tgz",
- "integrity": "sha512-Ii+sehpSfZy+At5nPdnyMhx78fEoPDkR2XW/zimHEL3MyGJQOCQ7WeP20jPYRz7ZCpcKLB21NxuXHF3bxjStBQ==",
- "engines": {
- "node": ">= 0.10"
- }
- },
"node_modules/vary": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
diff --git a/microfrontends/SignDocuments/package.json b/microfrontends/SignDocuments/package.json
index 8389bf007..97970e988 100644
--- a/microfrontends/SignDocuments/package.json
+++ b/microfrontends/SignDocuments/package.json
@@ -32,7 +32,6 @@
"react-scrollbars-custom": "^4.1.1",
"react-signature-canvas": "^1.0.6",
"reactour": "^1.19.1",
- "validator": "^13.11.0",
"web-vitals": "^2.1.4"
},
"scripts": {
diff --git a/microfrontends/SignDocuments/src/utils/Utils.js b/microfrontends/SignDocuments/src/utils/Utils.js
index 0413c7d87..f7d42f214 100644
--- a/microfrontends/SignDocuments/src/utils/Utils.js
+++ b/microfrontends/SignDocuments/src/utils/Utils.js
@@ -1,5 +1,4 @@
import axios from "axios";
-import validator from 'validator';
export async function getBase64FromUrl(url) {
const data = await fetch(url);
@@ -303,5 +302,10 @@ export const contactBook = async (objectId) => {
// function for validating URLs
export function urlValidator(url) {
- return validator.isURL(url);
+ try {
+ const newUrl = new URL(url);
+ return newUrl.protocol === 'http:' || newUrl.protocol === 'https:';
+ } catch (err) {
+ return false;
+ }
};
\ No newline at end of file