-
Notifications
You must be signed in to change notification settings - Fork 63
/
Copy pathvalidate.js
52 lines (45 loc) · 1.01 KB
/
validate.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/* eslint-disable-next-line max-len */
// ----------------------------------Journal Validation------------------------------
export const JournalValidation = (
title,
url,
issn,
rating,
policyTitle,
firstYear,
lastYear,
policyType,
domain,
date,
) => {
if (
title.length < 3 ||
url.length < 5 ||
issn.length < 1 ||
rating.length < 1 ||
date.length < 1 ||
policyTitle.length < 1 ||
firstYear.length < 1 ||
lastYear.length < 1 ||
policyType.length < 1 ||
domain.length < 1 ||
!date
) {
return false;
}
return true;
};
// ----------------------------------Signup Validation------------------------------
export const SignupValidation = ({ username, email }) => {
if (username < 1 || email < 1) {
return false;
}
return true;
};
// ----------------------------------Login Validation------------------------------
export const LoginValidation = ({ email, password }) => {
if (email < 1 || password < 1) {
return false;
}
return true;
};