This repository has been archived by the owner on Apr 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathmod.ts
174 lines (169 loc) · 4.81 KB
/
mod.ts
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
import equals from "./src/lib/equals.ts";
import contains from "./src/lib/contains.ts";
import blacklist from "./src/lib/blacklist.ts";
import escape from "./src/lib/escape.ts";
// validator version
const version = "1.0.0-beta";
// validators
import isAfter from "./src/lib/isAfter.ts";
import isAlpha, {
locales as isAlphaLocales,
} from "./src/lib/isAlpha.ts";
import isAlphanumeric, {
locales as isAlphanumericLocales,
} from "./src/lib/isAlphanumeric.ts";
import isAscii from "./src/lib/isAscii.ts";
import isBase32 from "./src/lib/isBase32.ts";
import isBase64 from "./src/lib/isBase64.ts";
import isBefore from "./src/lib/isBefore.ts";
import isBIC from "./src/lib/isBIC.ts";
import isBoolean from "./src/lib/isBoolean.ts";
import isBtcAddress from "./src/lib/isBtcAddress.ts";
import isByteLength from "./src/lib/isByteLength.ts";
import isCreditCard from "./src/lib/isCreditCard.ts";
import isCurrency from "./src/lib/isCurrency.ts";
import isDataURI from "./src/lib/isDataURI.ts";
import isDate from "./src/lib/isDate.ts";
import isDecimal from "./src/lib/isDecimal.ts";
import isDivisibleBy from "./src/lib/isDivisibleBy.ts";
import isEAN from "./src/lib/isEAN.ts";
import isEmail from "./src/lib/isEmail.ts";
import isEmpty from "./src/lib/isEmpty.ts";
import isEthereumAddress from "./src/lib/isEthereumAddress.ts";
import isFloat from "./src/lib/isFloat.ts";
import isFullWidth from "./src/lib/isFullWidth.ts";
import isFQDN from "./src/lib/isFQDN.ts";
import isHalfWidth from "./src/lib/isHalfWidth.ts";
import isHash from "./src/lib/isHash.ts";
import isHexadecimal from "./src/lib/isHexadecimal.ts";
import isHexColor from "./src/lib/isHexColor.ts";
import isHSL from "./src/lib/isHSL.ts";
import isIBAN from "./src/lib/isIBAN.ts";
import isIdentityCard from "./src/lib/isIdentityCard.ts";
import isIn from "./src/lib/isIn.ts";
import isInt from "./src/lib/isInt.ts";
import isIP from "./src/lib/isIP.ts";
import isIPRange from "./src/lib/isIPRange.ts";
import isISBN from "./src/lib/isISBN.ts";
import isISIN from "./src/lib/isISIN.ts";
import isISO31661Alpha2 from "./src/lib/isISO31661Alpha2.ts";
import isISO31661Alpha3 from "./src/lib/isISO31661Alpha3.ts";
import isISO8601 from "./src/lib/isISO8601.ts";
import isISRC from "./src/lib/isISRC.ts";
import isISSN from "./src/lib/isISSN.ts";
import isJSON from "./src/lib/isJSON.ts";
import isJWT from "./src/lib/isJWT.ts";
import isLatLong from "./src/lib/isLatLong.ts";
import isLocale from "./src/lib/isLocale.ts";
import isLowerCase from "./src/lib/isLowerCase.ts";
import isMACAddress from "./src/lib/isMACAddress.ts";
import isMagnetURI from "./src/lib/isMagnetURI.ts";
import isMimeType from "./src/lib/isMimeType.ts";
import isMongoId from "./src/lib/isMongoId.ts";
import isMobilePhone, {
locales as mobilePhoneLocales,
} from "./src/lib/isMobilePhone.ts";
import isMultibyte from "./src/lib/isMultibyte.ts";
import isNumeric from "./src/lib/isNumeric.ts";
import isOctal from "./src/lib/isOctal.ts";
import isPassportNumber from "./src/lib/isPassportNumber.ts";
import isPort from "./src/lib/isPort.ts";
import isPostalCode, {
locales as postalCodeLocales,
} from "./src/lib/isPostalCode.ts";
import isRFC3339 from "./src/lib/isRFC3339.ts";
import isRgbColor from "./src/lib/isRgbColor.ts";
import isSemVer from "./src/lib/isSemVer.ts";
import isSlug from "./src/lib/isSlug.ts";
import isSurrogatePair from "./src/lib/isSurrogatePair.ts";
import isUpperCase from "./src/lib/isUpperCase.ts";
import isURL from "./src/lib/isURL.ts";
import isUUID from "./src/lib/isUUID.ts";
import isVariableWidth from "./src/lib/isVariableWidth.ts";
import isWhitelisted from "./src/lib/isWhitelisted.ts";
import matches from "./src/lib/matches.ts";
// For testing (resolving keys as string)
interface ValidatorMap {
[key: string]: any;
}
const validator: ValidatorMap = {
equals,
contains,
blacklist,
escape,
isAfter,
isAlpha,
isAlphaLocales,
isAlphanumeric,
isAlphanumericLocales,
isAscii,
isBase32,
isBase64,
isBefore,
isBIC,
isBoolean,
isBtcAddress,
isByteLength,
isCreditCard,
isCurrency,
isDataURI,
isDate,
isDecimal,
isDivisibleBy,
isEAN,
isEmail,
isEmpty,
isEthereumAddress,
isFloat,
isFQDN,
isFullWidth,
isHalfWidth,
isHash,
isHexadecimal,
isHexColor,
isHSL,
isIBAN,
isIdentityCard,
isIn,
isInt,
isISIN,
isISO31661Alpha2,
isISO31661Alpha3,
isISO8601,
isISBN,
isISRC,
isISSN,
isJSON,
isIP,
isIPRange,
isJWT,
isLatLong,
isLocale,
isLowerCase,
isMACAddress,
isMagnetURI,
isMimeType,
isMongoId,
isMobilePhone,
isMultibyte,
isNumeric,
isOctal,
isPassportNumber,
isPort,
isPostalCode,
isRFC3339,
isRgbColor,
isSemVer,
isSlug,
isSurrogatePair,
isUpperCase,
isURL,
isUUID,
isVariableWidth,
isWhitelisted,
matches,
mobilePhoneLocales,
postalCodeLocales,
version,
};
export default validator;