forked from validatorjs/validator.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
243 lines (166 loc) · 8.32 KB
/
index.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _toDate = _interopRequireDefault(require("./lib/toDate"));
var _toFloat = _interopRequireDefault(require("./lib/toFloat"));
var _toInt = _interopRequireDefault(require("./lib/toInt"));
var _toBoolean = _interopRequireDefault(require("./lib/toBoolean"));
var _equals = _interopRequireDefault(require("./lib/equals"));
var _contains = _interopRequireDefault(require("./lib/contains"));
var _matches = _interopRequireDefault(require("./lib/matches"));
var _isEmail = _interopRequireDefault(require("./lib/isEmail"));
var _isURL = _interopRequireDefault(require("./lib/isURL"));
var _isMACAddress = _interopRequireDefault(require("./lib/isMACAddress"));
var _isIP = _interopRequireDefault(require("./lib/isIP"));
var _isIPRange = _interopRequireDefault(require("./lib/isIPRange"));
var _isFQDN = _interopRequireDefault(require("./lib/isFQDN"));
var _isBoolean = _interopRequireDefault(require("./lib/isBoolean"));
var _isAlpha = _interopRequireWildcard(require("./lib/isAlpha"));
var _isAlphanumeric = _interopRequireWildcard(require("./lib/isAlphanumeric"));
var _isNumeric = _interopRequireDefault(require("./lib/isNumeric"));
var _isPort = _interopRequireDefault(require("./lib/isPort"));
var _isLowercase = _interopRequireDefault(require("./lib/isLowercase"));
var _isUppercase = _interopRequireDefault(require("./lib/isUppercase"));
var _isAscii = _interopRequireDefault(require("./lib/isAscii"));
var _isFullWidth = _interopRequireDefault(require("./lib/isFullWidth"));
var _isHalfWidth = _interopRequireDefault(require("./lib/isHalfWidth"));
var _isVariableWidth = _interopRequireDefault(require("./lib/isVariableWidth"));
var _isMultibyte = _interopRequireDefault(require("./lib/isMultibyte"));
var _isSurrogatePair = _interopRequireDefault(require("./lib/isSurrogatePair"));
var _isInt = _interopRequireDefault(require("./lib/isInt"));
var _isFloat = _interopRequireWildcard(require("./lib/isFloat"));
var _isDecimal = _interopRequireDefault(require("./lib/isDecimal"));
var _isHexadecimal = _interopRequireDefault(require("./lib/isHexadecimal"));
var _isDivisibleBy = _interopRequireDefault(require("./lib/isDivisibleBy"));
var _isHexColor = _interopRequireDefault(require("./lib/isHexColor"));
var _isISRC = _interopRequireDefault(require("./lib/isISRC"));
var _isMD = _interopRequireDefault(require("./lib/isMD5"));
var _isHash = _interopRequireDefault(require("./lib/isHash"));
var _isJWT = _interopRequireDefault(require("./lib/isJWT"));
var _isJSON = _interopRequireDefault(require("./lib/isJSON"));
var _isEmpty = _interopRequireDefault(require("./lib/isEmpty"));
var _isLength = _interopRequireDefault(require("./lib/isLength"));
var _isByteLength = _interopRequireDefault(require("./lib/isByteLength"));
var _isUUID = _interopRequireDefault(require("./lib/isUUID"));
var _isMongoId = _interopRequireDefault(require("./lib/isMongoId"));
var _isAfter = _interopRequireDefault(require("./lib/isAfter"));
var _isBefore = _interopRequireDefault(require("./lib/isBefore"));
var _isIn = _interopRequireDefault(require("./lib/isIn"));
var _isCreditCard = _interopRequireDefault(require("./lib/isCreditCard"));
var _isIdentityCard = _interopRequireDefault(require("./lib/isIdentityCard"));
var _isISIN = _interopRequireDefault(require("./lib/isISIN"));
var _isISBN = _interopRequireDefault(require("./lib/isISBN"));
var _isISSN = _interopRequireDefault(require("./lib/isISSN"));
var _isMobilePhone = _interopRequireWildcard(require("./lib/isMobilePhone"));
var _isCurrency = _interopRequireDefault(require("./lib/isCurrency"));
var _isISO = _interopRequireDefault(require("./lib/isISO8601"));
var _isRFC = _interopRequireDefault(require("./lib/isRFC3339"));
var _isISO31661Alpha = _interopRequireDefault(require("./lib/isISO31661Alpha2"));
var _isISO31661Alpha2 = _interopRequireDefault(require("./lib/isISO31661Alpha3"));
var _isBase = _interopRequireDefault(require("./lib/isBase64"));
var _isDataURI = _interopRequireDefault(require("./lib/isDataURI"));
var _isMagnetURI = _interopRequireDefault(require("./lib/isMagnetURI"));
var _isMimeType = _interopRequireDefault(require("./lib/isMimeType"));
var _isLatLong = _interopRequireDefault(require("./lib/isLatLong"));
var _isPostalCode = _interopRequireWildcard(require("./lib/isPostalCode"));
var _ltrim = _interopRequireDefault(require("./lib/ltrim"));
var _rtrim = _interopRequireDefault(require("./lib/rtrim"));
var _trim = _interopRequireDefault(require("./lib/trim"));
var _escape = _interopRequireDefault(require("./lib/escape"));
var _unescape = _interopRequireDefault(require("./lib/unescape"));
var _stripLow = _interopRequireDefault(require("./lib/stripLow"));
var _whitelist = _interopRequireDefault(require("./lib/whitelist"));
var _blacklist = _interopRequireDefault(require("./lib/blacklist"));
var _isWhitelisted = _interopRequireDefault(require("./lib/isWhitelisted"));
var _normalizeEmail = _interopRequireDefault(require("./lib/normalizeEmail"));
var _toString = _interopRequireDefault(require("./lib/util/toString"));
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var version = '10.11.0';
var validator = {
version: version,
toDate: _toDate.default,
toFloat: _toFloat.default,
toInt: _toInt.default,
toBoolean: _toBoolean.default,
equals: _equals.default,
contains: _contains.default,
matches: _matches.default,
isEmail: _isEmail.default,
isURL: _isURL.default,
isMACAddress: _isMACAddress.default,
isIP: _isIP.default,
isIPRange: _isIPRange.default,
isFQDN: _isFQDN.default,
isBoolean: _isBoolean.default,
isAlpha: _isAlpha.default,
isAlphaLocales: _isAlpha.locales,
isAlphanumeric: _isAlphanumeric.default,
isAlphanumericLocales: _isAlphanumeric.locales,
isNumeric: _isNumeric.default,
isPort: _isPort.default,
isLowercase: _isLowercase.default,
isUppercase: _isUppercase.default,
isAscii: _isAscii.default,
isFullWidth: _isFullWidth.default,
isHalfWidth: _isHalfWidth.default,
isVariableWidth: _isVariableWidth.default,
isMultibyte: _isMultibyte.default,
isSurrogatePair: _isSurrogatePair.default,
isInt: _isInt.default,
isFloat: _isFloat.default,
isFloatLocales: _isFloat.locales,
isDecimal: _isDecimal.default,
isHexadecimal: _isHexadecimal.default,
isDivisibleBy: _isDivisibleBy.default,
isHexColor: _isHexColor.default,
isISRC: _isISRC.default,
isMD5: _isMD.default,
isHash: _isHash.default,
isJWT: _isJWT.default,
isJSON: _isJSON.default,
isEmpty: _isEmpty.default,
isLength: _isLength.default,
isByteLength: _isByteLength.default,
isUUID: _isUUID.default,
isMongoId: _isMongoId.default,
isAfter: _isAfter.default,
isBefore: _isBefore.default,
isIn: _isIn.default,
isCreditCard: _isCreditCard.default,
isIdentityCard: _isIdentityCard.default,
isISIN: _isISIN.default,
isISBN: _isISBN.default,
isISSN: _isISSN.default,
isMobilePhone: _isMobilePhone.default,
isMobilePhoneLocales: _isMobilePhone.locales,
isPostalCode: _isPostalCode.default,
isPostalCodeLocales: _isPostalCode.locales,
isCurrency: _isCurrency.default,
isISO8601: _isISO.default,
isRFC3339: _isRFC.default,
isISO31661Alpha2: _isISO31661Alpha.default,
isISO31661Alpha3: _isISO31661Alpha2.default,
isBase64: _isBase.default,
isDataURI: _isDataURI.default,
isMagnetURI: _isMagnetURI.default,
isMimeType: _isMimeType.default,
isLatLong: _isLatLong.default,
ltrim: _ltrim.default,
rtrim: _rtrim.default,
trim: _trim.default,
escape: _escape.default,
unescape: _unescape.default,
stripLow: _stripLow.default,
whitelist: _whitelist.default,
blacklist: _blacklist.default,
isWhitelisted: _isWhitelisted.default,
normalizeEmail: _normalizeEmail.default,
toString: _toString.default
};
var _default = validator;
exports.default = _default;
module.exports = exports.default;
module.exports.default = exports.default;