Skip to content

Commit ce12f9c

Browse files
committed
Prettify
1 parent 47b5a40 commit ce12f9c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/components/textField/validators.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
import _ from 'lodash';
22
import {EmailValidator} from 'commons-validator-js';
33

4-
const urlRegEx = /^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?$/i; //eslint-disable-line
4+
const urlRegEx =
5+
/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?$/i; //eslint-disable-line
56
const decimalNumberRegEx = /^-?\d+[.,]?\d+$/;
67
const integerRegEx = /^-?\d*$/; // allows empty string
78
const priceRegEx = /^[0-9]{1,9}([.][0-9]{1,2})?$/;
89

910
const validators = {
1011
required: (value = '') => !_.isEmpty(value),
1112
email: (value = '') => new EmailValidator().isValid(value),
12-
optionalEmail : (value = '') => {
13+
optionalEmail: (value = '') => {
1314
// Allow empty strings
1415
if (_.isEmpty(value)) {
1516
return true;

0 commit comments

Comments
 (0)