forked from validatorjs/validator.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
367 lines (222 loc) · 9.41 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
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _toDate = require('./lib/toDate');
var _toDate2 = _interopRequireDefault(_toDate);
var _toFloat = require('./lib/toFloat');
var _toFloat2 = _interopRequireDefault(_toFloat);
var _toInt = require('./lib/toInt');
var _toInt2 = _interopRequireDefault(_toInt);
var _toBoolean = require('./lib/toBoolean');
var _toBoolean2 = _interopRequireDefault(_toBoolean);
var _equals = require('./lib/equals');
var _equals2 = _interopRequireDefault(_equals);
var _contains = require('./lib/contains');
var _contains2 = _interopRequireDefault(_contains);
var _matches = require('./lib/matches');
var _matches2 = _interopRequireDefault(_matches);
var _isEmail = require('./lib/isEmail');
var _isEmail2 = _interopRequireDefault(_isEmail);
var _isURL = require('./lib/isURL');
var _isURL2 = _interopRequireDefault(_isURL);
var _isMACAddress = require('./lib/isMACAddress');
var _isMACAddress2 = _interopRequireDefault(_isMACAddress);
var _isIP = require('./lib/isIP');
var _isIP2 = _interopRequireDefault(_isIP);
var _isIPRange = require('./lib/isIPRange');
var _isIPRange2 = _interopRequireDefault(_isIPRange);
var _isFQDN = require('./lib/isFQDN');
var _isFQDN2 = _interopRequireDefault(_isFQDN);
var _isBoolean = require('./lib/isBoolean');
var _isBoolean2 = _interopRequireDefault(_isBoolean);
var _isAlpha = require('./lib/isAlpha');
var _isAlpha2 = _interopRequireDefault(_isAlpha);
var _isAlphanumeric = require('./lib/isAlphanumeric');
var _isAlphanumeric2 = _interopRequireDefault(_isAlphanumeric);
var _isNumeric = require('./lib/isNumeric');
var _isNumeric2 = _interopRequireDefault(_isNumeric);
var _isPort = require('./lib/isPort');
var _isPort2 = _interopRequireDefault(_isPort);
var _isLowercase = require('./lib/isLowercase');
var _isLowercase2 = _interopRequireDefault(_isLowercase);
var _isUppercase = require('./lib/isUppercase');
var _isUppercase2 = _interopRequireDefault(_isUppercase);
var _isAscii = require('./lib/isAscii');
var _isAscii2 = _interopRequireDefault(_isAscii);
var _isFullWidth = require('./lib/isFullWidth');
var _isFullWidth2 = _interopRequireDefault(_isFullWidth);
var _isHalfWidth = require('./lib/isHalfWidth');
var _isHalfWidth2 = _interopRequireDefault(_isHalfWidth);
var _isVariableWidth = require('./lib/isVariableWidth');
var _isVariableWidth2 = _interopRequireDefault(_isVariableWidth);
var _isMultibyte = require('./lib/isMultibyte');
var _isMultibyte2 = _interopRequireDefault(_isMultibyte);
var _isSurrogatePair = require('./lib/isSurrogatePair');
var _isSurrogatePair2 = _interopRequireDefault(_isSurrogatePair);
var _isInt = require('./lib/isInt');
var _isInt2 = _interopRequireDefault(_isInt);
var _isFloat = require('./lib/isFloat');
var _isFloat2 = _interopRequireDefault(_isFloat);
var _isDecimal = require('./lib/isDecimal');
var _isDecimal2 = _interopRequireDefault(_isDecimal);
var _isHexadecimal = require('./lib/isHexadecimal');
var _isHexadecimal2 = _interopRequireDefault(_isHexadecimal);
var _isDivisibleBy = require('./lib/isDivisibleBy');
var _isDivisibleBy2 = _interopRequireDefault(_isDivisibleBy);
var _isHexColor = require('./lib/isHexColor');
var _isHexColor2 = _interopRequireDefault(_isHexColor);
var _isISRC = require('./lib/isISRC');
var _isISRC2 = _interopRequireDefault(_isISRC);
var _isMD = require('./lib/isMD5');
var _isMD2 = _interopRequireDefault(_isMD);
var _isHash = require('./lib/isHash');
var _isHash2 = _interopRequireDefault(_isHash);
var _isJSON = require('./lib/isJSON');
var _isJSON2 = _interopRequireDefault(_isJSON);
var _isEmpty = require('./lib/isEmpty');
var _isEmpty2 = _interopRequireDefault(_isEmpty);
var _isLength = require('./lib/isLength');
var _isLength2 = _interopRequireDefault(_isLength);
var _isByteLength = require('./lib/isByteLength');
var _isByteLength2 = _interopRequireDefault(_isByteLength);
var _isUUID = require('./lib/isUUID');
var _isUUID2 = _interopRequireDefault(_isUUID);
var _isMongoId = require('./lib/isMongoId');
var _isMongoId2 = _interopRequireDefault(_isMongoId);
var _isAfter = require('./lib/isAfter');
var _isAfter2 = _interopRequireDefault(_isAfter);
var _isBefore = require('./lib/isBefore');
var _isBefore2 = _interopRequireDefault(_isBefore);
var _isIn = require('./lib/isIn');
var _isIn2 = _interopRequireDefault(_isIn);
var _isCreditCard = require('./lib/isCreditCard');
var _isCreditCard2 = _interopRequireDefault(_isCreditCard);
var _isISIN = require('./lib/isISIN');
var _isISIN2 = _interopRequireDefault(_isISIN);
var _isISBN = require('./lib/isISBN');
var _isISBN2 = _interopRequireDefault(_isISBN);
var _isISSN = require('./lib/isISSN');
var _isISSN2 = _interopRequireDefault(_isISSN);
var _isMobilePhone = require('./lib/isMobilePhone');
var _isMobilePhone2 = _interopRequireDefault(_isMobilePhone);
var _isCurrency = require('./lib/isCurrency');
var _isCurrency2 = _interopRequireDefault(_isCurrency);
var _isISO = require('./lib/isISO8601');
var _isISO2 = _interopRequireDefault(_isISO);
var _isRFC = require('./lib/isRFC3339');
var _isRFC2 = _interopRequireDefault(_isRFC);
var _isISO31661Alpha = require('./lib/isISO31661Alpha2');
var _isISO31661Alpha2 = _interopRequireDefault(_isISO31661Alpha);
var _isISO31661Alpha3 = require('./lib/isISO31661Alpha3');
var _isISO31661Alpha4 = _interopRequireDefault(_isISO31661Alpha3);
var _isBase = require('./lib/isBase64');
var _isBase2 = _interopRequireDefault(_isBase);
var _isDataURI = require('./lib/isDataURI');
var _isDataURI2 = _interopRequireDefault(_isDataURI);
var _isMimeType = require('./lib/isMimeType');
var _isMimeType2 = _interopRequireDefault(_isMimeType);
var _isLatLong = require('./lib/isLatLong');
var _isLatLong2 = _interopRequireDefault(_isLatLong);
var _isPostalCode = require('./lib/isPostalCode');
var _isPostalCode2 = _interopRequireDefault(_isPostalCode);
var _ltrim = require('./lib/ltrim');
var _ltrim2 = _interopRequireDefault(_ltrim);
var _rtrim = require('./lib/rtrim');
var _rtrim2 = _interopRequireDefault(_rtrim);
var _trim = require('./lib/trim');
var _trim2 = _interopRequireDefault(_trim);
var _escape = require('./lib/escape');
var _escape2 = _interopRequireDefault(_escape);
var _unescape = require('./lib/unescape');
var _unescape2 = _interopRequireDefault(_unescape);
var _stripLow = require('./lib/stripLow');
var _stripLow2 = _interopRequireDefault(_stripLow);
var _whitelist = require('./lib/whitelist');
var _whitelist2 = _interopRequireDefault(_whitelist);
var _blacklist = require('./lib/blacklist');
var _blacklist2 = _interopRequireDefault(_blacklist);
var _isWhitelisted = require('./lib/isWhitelisted');
var _isWhitelisted2 = _interopRequireDefault(_isWhitelisted);
var _normalizeEmail = require('./lib/normalizeEmail');
var _normalizeEmail2 = _interopRequireDefault(_normalizeEmail);
var _toString = require('./lib/util/toString');
var _toString2 = _interopRequireDefault(_toString);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var version = '10.4.0';
var validator = {
version: version,
toDate: _toDate2.default,
toFloat: _toFloat2.default,
toInt: _toInt2.default,
toBoolean: _toBoolean2.default,
equals: _equals2.default,
contains: _contains2.default,
matches: _matches2.default,
isEmail: _isEmail2.default,
isURL: _isURL2.default,
isMACAddress: _isMACAddress2.default,
isIP: _isIP2.default,
isIPRange: _isIPRange2.default,
isFQDN: _isFQDN2.default,
isBoolean: _isBoolean2.default,
isAlpha: _isAlpha2.default,
isAlphanumeric: _isAlphanumeric2.default,
isNumeric: _isNumeric2.default,
isPort: _isPort2.default,
isLowercase: _isLowercase2.default,
isUppercase: _isUppercase2.default,
isAscii: _isAscii2.default,
isFullWidth: _isFullWidth2.default,
isHalfWidth: _isHalfWidth2.default,
isVariableWidth: _isVariableWidth2.default,
isMultibyte: _isMultibyte2.default,
isSurrogatePair: _isSurrogatePair2.default,
isInt: _isInt2.default,
isFloat: _isFloat2.default,
isDecimal: _isDecimal2.default,
isHexadecimal: _isHexadecimal2.default,
isDivisibleBy: _isDivisibleBy2.default,
isHexColor: _isHexColor2.default,
isISRC: _isISRC2.default,
isMD5: _isMD2.default,
isHash: _isHash2.default,
isJSON: _isJSON2.default,
isEmpty: _isEmpty2.default,
isLength: _isLength2.default,
isByteLength: _isByteLength2.default,
isUUID: _isUUID2.default,
isMongoId: _isMongoId2.default,
isAfter: _isAfter2.default,
isBefore: _isBefore2.default,
isIn: _isIn2.default,
isCreditCard: _isCreditCard2.default,
isISIN: _isISIN2.default,
isISBN: _isISBN2.default,
isISSN: _isISSN2.default,
isMobilePhone: _isMobilePhone2.default,
isPostalCode: _isPostalCode2.default,
isPostalCodeLocales: _isPostalCode.locales,
isCurrency: _isCurrency2.default,
isISO8601: _isISO2.default,
isRFC3339: _isRFC2.default,
isISO31661Alpha2: _isISO31661Alpha2.default,
isISO31661Alpha3: _isISO31661Alpha4.default,
isBase64: _isBase2.default,
isDataURI: _isDataURI2.default,
isMimeType: _isMimeType2.default,
isLatLong: _isLatLong2.default,
ltrim: _ltrim2.default,
rtrim: _rtrim2.default,
trim: _trim2.default,
escape: _escape2.default,
unescape: _unescape2.default,
stripLow: _stripLow2.default,
whitelist: _whitelist2.default,
blacklist: _blacklist2.default,
isWhitelisted: _isWhitelisted2.default,
normalizeEmail: _normalizeEmail2.default,
toString: _toString2.default
};
exports.default = validator;
module.exports = exports['default'];