Skip to content

Commit 1b3508a

Browse files
Replace npm package with manual valiadation
1 parent 3992a9b commit 1b3508a

File tree

3 files changed

+6
-12
lines changed

3 files changed

+6
-12
lines changed

microfrontends/SignDocuments/package-lock.json

Lines changed: 0 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

microfrontends/SignDocuments/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
"react-scrollbars-custom": "^4.1.1",
3333
"react-signature-canvas": "^1.0.6",
3434
"reactour": "^1.19.1",
35-
"validator": "^13.11.0",
3635
"web-vitals": "^2.1.4"
3736
},
3837
"scripts": {

microfrontends/SignDocuments/src/utils/Utils.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import axios from "axios";
2-
import validator from 'validator';
32

43
export async function getBase64FromUrl(url) {
54
const data = await fetch(url);
@@ -303,5 +302,10 @@ export const contactBook = async (objectId) => {
303302

304303
// function for validating URLs
305304
export function urlValidator(url) {
306-
return validator.isURL(url);
305+
try {
306+
const newUrl = new URL(url);
307+
return newUrl.protocol === 'http:' || newUrl.protocol === 'https:';
308+
} catch (err) {
309+
return false;
310+
}
307311
};

0 commit comments

Comments
 (0)