-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrules.js
36 lines (34 loc) · 949 Bytes
/
rules.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
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var defaultMessage = {
onEmpty: 'is Required',
notValid: 'is not valid'
};
var rules = {
Email: {
regex: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
onEmpty: defaultMessage.onEmpty,
notValid: defaultMessage.notValid
},
Domain: {
regex: /^[\w]*\.[a-z]{2,6}$/,
onEmpty: defaultMessage.onEmpty,
notValid: defaultMessage.notValid
},
Phonenumber: {
regex: /^[\d]{10,12}$/,
onEmpty: defaultMessage.onEmpty,
notValid: defaultMessage.notValid
},
Text: {
onEmpty: defaultMessage.onEmpty
},
Number: {
regex: /^\d+$/,
onEmpty: defaultMessage.onEmpty,
notValid: defaultMessage.notValid
}
};
exports.default = rules;