@jdsalasc/solvejs-validators 1.0.3 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -11
- package/dist/cjs/index.cjs +370 -60
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.d.ts +176 -15
- package/dist/esm/index.js +355 -60
- package/dist/esm/index.js.map +1 -1
- package/package.json +54 -52
package/dist/esm/index.js
CHANGED
|
@@ -1,120 +1,415 @@
|
|
|
1
|
-
const ADDRESS_DIRECTIONS =
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
const ADDRESS_DIRECTIONS = {
|
|
2
|
+
en: new Set([
|
|
3
|
+
"N",
|
|
4
|
+
"S",
|
|
5
|
+
"E",
|
|
6
|
+
"W",
|
|
7
|
+
"NE",
|
|
8
|
+
"NW",
|
|
9
|
+
"SE",
|
|
10
|
+
"SW",
|
|
11
|
+
"NORTH",
|
|
12
|
+
"SOUTH",
|
|
13
|
+
"EAST",
|
|
14
|
+
"WEST",
|
|
15
|
+
"NORTHEAST",
|
|
16
|
+
"NORTHWEST",
|
|
17
|
+
"SOUTHEAST",
|
|
18
|
+
"SOUTHWEST"
|
|
19
|
+
]),
|
|
20
|
+
es: new Set([
|
|
21
|
+
"N",
|
|
22
|
+
"S",
|
|
23
|
+
"E",
|
|
24
|
+
"O",
|
|
25
|
+
"NE",
|
|
26
|
+
"NO",
|
|
27
|
+
"SE",
|
|
28
|
+
"SO",
|
|
29
|
+
"NORTE",
|
|
30
|
+
"SUR",
|
|
31
|
+
"ESTE",
|
|
32
|
+
"OESTE",
|
|
33
|
+
"NORESTE",
|
|
34
|
+
"NOROESTE",
|
|
35
|
+
"SURESTE",
|
|
36
|
+
"SUROESTE"
|
|
37
|
+
])
|
|
38
|
+
};
|
|
39
|
+
const COUNTRY_RULES = {
|
|
40
|
+
US: { minDigits: 10, maxDigits: 11 },
|
|
41
|
+
CO: { minDigits: 10, maxDigits: 12 },
|
|
42
|
+
MX: { minDigits: 10, maxDigits: 13 },
|
|
43
|
+
ES: { minDigits: 9, maxDigits: 11 }
|
|
44
|
+
};
|
|
45
|
+
function ok(message = "Validation passed.") {
|
|
46
|
+
return { ok: true, code: "VALID", message };
|
|
47
|
+
}
|
|
48
|
+
function fail(code, message) {
|
|
49
|
+
return { ok: false, code, message };
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Validates cellphone numbers using regional presets.
|
|
21
53
|
*
|
|
22
54
|
* @param value - Input phone string.
|
|
23
55
|
* @param options - Validation options.
|
|
24
56
|
* @param options.allowInternational - Allows a leading `+`.
|
|
25
|
-
* @param options.
|
|
26
|
-
* @param options.
|
|
27
|
-
* @
|
|
57
|
+
* @param options.country - Country preset used for length constraints.
|
|
58
|
+
* @param options.minDigits - Override minimum digits.
|
|
59
|
+
* @param options.maxDigits - Override maximum digits.
|
|
60
|
+
* @returns Structured validation result.
|
|
28
61
|
*/
|
|
29
|
-
export function
|
|
62
|
+
export function validateCellphoneNumber(value, options = {}) {
|
|
30
63
|
const allowInternational = options.allowInternational ?? true;
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
64
|
+
const country = options.country ?? "ANY";
|
|
65
|
+
if (!["ANY", "US", "CO", "MX", "ES"].includes(country)) {
|
|
66
|
+
return fail("UNSUPPORTED_COUNTRY", `Unsupported country preset: ${country}.`);
|
|
67
|
+
}
|
|
68
|
+
const normalized = value.trim();
|
|
69
|
+
if (normalized.length === 0) {
|
|
70
|
+
return fail("EMPTY", "Phone number cannot be empty.");
|
|
71
|
+
}
|
|
72
|
+
const compact = normalized.replace(/[\s().-]/g, "");
|
|
34
73
|
const pattern = allowInternational ? /^\+?\d+$/ : /^\d+$/;
|
|
35
|
-
if (!pattern.test(
|
|
36
|
-
return
|
|
74
|
+
if (!pattern.test(compact)) {
|
|
75
|
+
return fail("INVALID_FORMAT", "Phone number contains invalid characters.");
|
|
76
|
+
}
|
|
77
|
+
const digits = compact.startsWith("+") ? compact.slice(1) : compact;
|
|
78
|
+
const preset = country === "ANY" ? { minDigits: 7, maxDigits: 15 } : COUNTRY_RULES[country];
|
|
79
|
+
const minDigits = options.minDigits ?? preset.minDigits;
|
|
80
|
+
const maxDigits = options.maxDigits ?? preset.maxDigits;
|
|
81
|
+
if (digits.length < minDigits) {
|
|
82
|
+
return fail("TOO_SHORT", `Phone number must have at least ${minDigits} digits.`);
|
|
37
83
|
}
|
|
38
|
-
|
|
39
|
-
|
|
84
|
+
if (digits.length > maxDigits) {
|
|
85
|
+
return fail("TOO_LONG", `Phone number must have at most ${maxDigits} digits.`);
|
|
86
|
+
}
|
|
87
|
+
return ok("Valid cellphone number.");
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Boolean wrapper for `validateCellphoneNumber`.
|
|
91
|
+
*
|
|
92
|
+
* @param value - Input phone string.
|
|
93
|
+
* @param options - Validation options.
|
|
94
|
+
* @returns `true` when the value is valid.
|
|
95
|
+
*/
|
|
96
|
+
export function isCellphoneNumber(value, options = {}) {
|
|
97
|
+
return validateCellphoneNumber(value, options).ok;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Validates address direction using localized dictionaries.
|
|
101
|
+
*
|
|
102
|
+
* @param value - Direction text.
|
|
103
|
+
* @param options - Validation options.
|
|
104
|
+
* @param options.locale - Locale dictionary (`en`, `es`).
|
|
105
|
+
* @returns Structured validation result.
|
|
106
|
+
*/
|
|
107
|
+
export function validateAddressDirection(value, options = {}) {
|
|
108
|
+
const locale = options.locale ?? "en";
|
|
109
|
+
if (!ADDRESS_DIRECTIONS[locale]) {
|
|
110
|
+
return fail("UNSUPPORTED_LOCALE", `Unsupported direction locale: ${locale}.`);
|
|
111
|
+
}
|
|
112
|
+
const normalized = value.trim().toUpperCase();
|
|
113
|
+
if (!normalized) {
|
|
114
|
+
return fail("EMPTY", "Direction cannot be empty.");
|
|
115
|
+
}
|
|
116
|
+
return ADDRESS_DIRECTIONS[locale].has(normalized)
|
|
117
|
+
? ok("Valid address direction.")
|
|
118
|
+
: fail("INVALID_FORMAT", "Direction does not match locale dictionary.");
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Boolean wrapper for `validateAddressDirection`.
|
|
122
|
+
*
|
|
123
|
+
* @param value - Direction text.
|
|
124
|
+
* @param options - Validation options.
|
|
125
|
+
* @returns `true` when the value is valid.
|
|
126
|
+
*/
|
|
127
|
+
export function isAddressDirection(value, options = {}) {
|
|
128
|
+
return validateAddressDirection(value, options).ok;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Backward-compatible alias for users who typed the previous function with one missing `d`.
|
|
132
|
+
*
|
|
133
|
+
* @param value - Direction text.
|
|
134
|
+
* @param options - Validation options.
|
|
135
|
+
* @returns `true` when the direction is valid.
|
|
136
|
+
*/
|
|
137
|
+
export function isAddresDirection(value, options = {}) {
|
|
138
|
+
return isAddressDirection(value, options);
|
|
40
139
|
}
|
|
41
140
|
/**
|
|
42
|
-
*
|
|
141
|
+
* Backward-compatible alias for users who typed the previous function with two spelling mistakes.
|
|
43
142
|
*
|
|
44
143
|
* @param value - Direction text.
|
|
45
|
-
* @
|
|
144
|
+
* @param options - Validation options.
|
|
145
|
+
* @returns `true` when the direction is valid.
|
|
46
146
|
*/
|
|
47
|
-
export function
|
|
48
|
-
return
|
|
147
|
+
export function isAddresDirrection(value, options = {}) {
|
|
148
|
+
return isAddressDirection(value, options);
|
|
49
149
|
}
|
|
50
150
|
/**
|
|
51
|
-
* Validates names
|
|
151
|
+
* Validates person names with practical production constraints.
|
|
52
152
|
*
|
|
53
153
|
* @param value - Name string.
|
|
54
154
|
* @param options - Validation options.
|
|
55
155
|
* @param options.minLength - Minimum total length.
|
|
56
156
|
* @param options.maxLength - Maximum total length.
|
|
57
|
-
* @returns
|
|
157
|
+
* @returns Structured validation result.
|
|
58
158
|
*/
|
|
59
|
-
export function
|
|
159
|
+
export function validateName(value, options = {}) {
|
|
60
160
|
const minLength = options.minLength ?? 2;
|
|
61
161
|
const maxLength = options.maxLength ?? 80;
|
|
62
162
|
const normalized = value.trim();
|
|
63
|
-
if (normalized
|
|
64
|
-
return
|
|
163
|
+
if (!normalized) {
|
|
164
|
+
return fail("EMPTY", "Name cannot be empty.");
|
|
165
|
+
}
|
|
166
|
+
if (normalized.length < minLength) {
|
|
167
|
+
return fail("TOO_SHORT", `Name must have at least ${minLength} characters.`);
|
|
168
|
+
}
|
|
169
|
+
if (normalized.length > maxLength) {
|
|
170
|
+
return fail("TOO_LONG", `Name must have at most ${maxLength} characters.`);
|
|
171
|
+
}
|
|
172
|
+
if (!/^[A-Za-zÀ-ÖØ-öø-ÿ' -]+$/.test(normalized)) {
|
|
173
|
+
return fail("INVALID_CHARACTERS", "Name contains unsupported characters.");
|
|
174
|
+
}
|
|
175
|
+
return ok("Valid name.");
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Boolean wrapper for `validateName`.
|
|
179
|
+
*
|
|
180
|
+
* @param value - Name string.
|
|
181
|
+
* @param options - Validation options.
|
|
182
|
+
* @returns `true` when the value is valid.
|
|
183
|
+
*/
|
|
184
|
+
export function isValidName(value, options = {}) {
|
|
185
|
+
return validateName(value, options).ok;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Validates usernames used in sign-up forms.
|
|
189
|
+
*
|
|
190
|
+
* @param value - Username candidate.
|
|
191
|
+
* @param options - Validation options.
|
|
192
|
+
* @param options.minLength - Minimum length.
|
|
193
|
+
* @param options.maxLength - Maximum length.
|
|
194
|
+
* @returns Structured validation result.
|
|
195
|
+
*/
|
|
196
|
+
export function validateUsername(value, options = {}) {
|
|
197
|
+
const minLength = options.minLength ?? 3;
|
|
198
|
+
const maxLength = options.maxLength ?? 30;
|
|
199
|
+
const normalized = value.trim();
|
|
200
|
+
if (!normalized) {
|
|
201
|
+
return fail("EMPTY", "Username cannot be empty.");
|
|
202
|
+
}
|
|
203
|
+
if (normalized.length < minLength) {
|
|
204
|
+
return fail("TOO_SHORT", `Username must have at least ${minLength} characters.`);
|
|
205
|
+
}
|
|
206
|
+
if (normalized.length > maxLength) {
|
|
207
|
+
return fail("TOO_LONG", `Username must have at most ${maxLength} characters.`);
|
|
208
|
+
}
|
|
209
|
+
if (!/^[a-zA-Z0-9_]+$/.test(normalized)) {
|
|
210
|
+
return fail("INVALID_CHARACTERS", "Username can only contain letters, numbers, and underscores.");
|
|
211
|
+
}
|
|
212
|
+
return ok("Valid username.");
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Boolean wrapper for `validateUsername`.
|
|
216
|
+
*
|
|
217
|
+
* @param value - Username candidate.
|
|
218
|
+
* @param options - Validation options.
|
|
219
|
+
* @returns `true` when the username is valid.
|
|
220
|
+
*/
|
|
221
|
+
export function isUsername(value, options = {}) {
|
|
222
|
+
return validateUsername(value, options).ok;
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Validates an email shape.
|
|
226
|
+
*
|
|
227
|
+
* @param value - Email string.
|
|
228
|
+
* @returns Structured validation result.
|
|
229
|
+
*/
|
|
230
|
+
export function validateEmail(value) {
|
|
231
|
+
const normalized = value.trim();
|
|
232
|
+
if (!normalized) {
|
|
233
|
+
return fail("EMPTY", "Email cannot be empty.");
|
|
65
234
|
}
|
|
66
|
-
return /^[
|
|
235
|
+
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(normalized)
|
|
236
|
+
? ok("Valid email.")
|
|
237
|
+
: fail("INVALID_FORMAT", "Email does not match expected format.");
|
|
67
238
|
}
|
|
68
239
|
/**
|
|
69
|
-
*
|
|
240
|
+
* Boolean wrapper for `validateEmail`.
|
|
70
241
|
*
|
|
71
242
|
* @param value - Email string.
|
|
72
|
-
* @returns `true` when
|
|
243
|
+
* @returns `true` when the value is valid.
|
|
73
244
|
*/
|
|
74
245
|
export function isEmail(value) {
|
|
75
|
-
return
|
|
246
|
+
return validateEmail(value).ok;
|
|
76
247
|
}
|
|
77
248
|
/**
|
|
78
249
|
* Validates an HTTP(S) URL.
|
|
79
250
|
*
|
|
80
251
|
* @param value - URL string.
|
|
81
|
-
* @returns
|
|
252
|
+
* @returns Structured validation result.
|
|
82
253
|
*/
|
|
83
|
-
export function
|
|
254
|
+
export function validateHttpUrl(value) {
|
|
255
|
+
const normalized = value.trim();
|
|
256
|
+
if (!normalized) {
|
|
257
|
+
return fail("EMPTY", "URL cannot be empty.");
|
|
258
|
+
}
|
|
84
259
|
try {
|
|
85
|
-
const parsed = new URL(
|
|
86
|
-
|
|
260
|
+
const parsed = new URL(normalized);
|
|
261
|
+
if (parsed.protocol !== "http:" && parsed.protocol !== "https:") {
|
|
262
|
+
return fail("INVALID_FORMAT", "Only HTTP and HTTPS URLs are supported.");
|
|
263
|
+
}
|
|
264
|
+
return ok("Valid URL.");
|
|
87
265
|
}
|
|
88
266
|
catch {
|
|
89
|
-
return
|
|
267
|
+
return fail("INVALID_FORMAT", "URL does not match expected format.");
|
|
90
268
|
}
|
|
91
269
|
}
|
|
270
|
+
/**
|
|
271
|
+
* Boolean wrapper for `validateHttpUrl`.
|
|
272
|
+
*
|
|
273
|
+
* @param value - URL string.
|
|
274
|
+
* @returns `true` when the value is valid.
|
|
275
|
+
*/
|
|
276
|
+
export function isHttpUrl(value) {
|
|
277
|
+
return validateHttpUrl(value).ok;
|
|
278
|
+
}
|
|
92
279
|
/**
|
|
93
280
|
* Validates US-style postal codes (`12345` or `12345-6789`).
|
|
94
281
|
*
|
|
95
282
|
* @param value - Postal code string.
|
|
96
|
-
* @returns
|
|
283
|
+
* @returns Structured validation result.
|
|
284
|
+
*/
|
|
285
|
+
export function validatePostalCode(value) {
|
|
286
|
+
const normalized = value.trim();
|
|
287
|
+
if (!normalized) {
|
|
288
|
+
return fail("EMPTY", "Postal code cannot be empty.");
|
|
289
|
+
}
|
|
290
|
+
return /^\d{5}(?:-\d{4})?$/.test(normalized)
|
|
291
|
+
? ok("Valid postal code.")
|
|
292
|
+
: fail("INVALID_FORMAT", "Postal code does not match supported formats.");
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* Boolean wrapper for `validatePostalCode`.
|
|
296
|
+
*
|
|
297
|
+
* @param value - Postal code string.
|
|
298
|
+
* @returns `true` when the value is valid.
|
|
97
299
|
*/
|
|
98
300
|
export function isPostalCode(value) {
|
|
99
|
-
return
|
|
301
|
+
return validatePostalCode(value).ok;
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* Validates address line input for common delivery/billing forms.
|
|
305
|
+
*
|
|
306
|
+
* @param value - Address line string.
|
|
307
|
+
* @param options - Validation options.
|
|
308
|
+
* @param options.minLength - Minimum length.
|
|
309
|
+
* @param options.maxLength - Maximum length.
|
|
310
|
+
* @returns Structured validation result.
|
|
311
|
+
*/
|
|
312
|
+
export function validateAddressLine(value, options = {}) {
|
|
313
|
+
const minLength = options.minLength ?? 5;
|
|
314
|
+
const maxLength = options.maxLength ?? 120;
|
|
315
|
+
const normalized = value.trim();
|
|
316
|
+
if (!normalized) {
|
|
317
|
+
return fail("EMPTY", "Address line cannot be empty.");
|
|
318
|
+
}
|
|
319
|
+
if (normalized.length < minLength) {
|
|
320
|
+
return fail("TOO_SHORT", `Address line must have at least ${minLength} characters.`);
|
|
321
|
+
}
|
|
322
|
+
if (normalized.length > maxLength) {
|
|
323
|
+
return fail("TOO_LONG", `Address line must have at most ${maxLength} characters.`);
|
|
324
|
+
}
|
|
325
|
+
if (!/^[A-Za-z0-9À-ÖØ-öø-ÿ#.,'\/ -]+$/.test(normalized)) {
|
|
326
|
+
return fail("INVALID_CHARACTERS", "Address line contains unsupported characters.");
|
|
327
|
+
}
|
|
328
|
+
return ok("Valid address line.");
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* Boolean wrapper for `validateAddressLine`.
|
|
332
|
+
*
|
|
333
|
+
* @param value - Address line string.
|
|
334
|
+
* @param options - Validation options.
|
|
335
|
+
* @returns `true` when the address line is valid.
|
|
336
|
+
*/
|
|
337
|
+
export function isAddressLine(value, options = {}) {
|
|
338
|
+
return validateAddressLine(value, options).ok;
|
|
100
339
|
}
|
|
101
340
|
/**
|
|
102
|
-
* Validates password strength
|
|
341
|
+
* Validates password strength using default security checks.
|
|
103
342
|
*
|
|
104
343
|
* @param value - Password candidate.
|
|
105
344
|
* @param options - Validation options.
|
|
106
345
|
* @param options.minLength - Minimum required length.
|
|
107
|
-
* @returns
|
|
346
|
+
* @returns Structured validation result.
|
|
108
347
|
*/
|
|
109
|
-
export function
|
|
348
|
+
export function validateStrongPassword(value, options = {}) {
|
|
110
349
|
const minLength = options.minLength ?? 8;
|
|
350
|
+
if (!value) {
|
|
351
|
+
return fail("EMPTY", "Password cannot be empty.");
|
|
352
|
+
}
|
|
111
353
|
if (value.length < minLength) {
|
|
112
|
-
return
|
|
354
|
+
return fail("TOO_SHORT", `Password must have at least ${minLength} characters.`);
|
|
113
355
|
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
356
|
+
if (!/[A-Z]/.test(value) || !/[a-z]/.test(value) || !/\d/.test(value) || !/[^A-Za-z0-9]/.test(value)) {
|
|
357
|
+
return fail("INVALID_FORMAT", "Password must include upper, lower, digit, and symbol characters.");
|
|
358
|
+
}
|
|
359
|
+
return ok("Strong password.");
|
|
360
|
+
}
|
|
361
|
+
/**
|
|
362
|
+
* Boolean wrapper for `validateStrongPassword`.
|
|
363
|
+
*
|
|
364
|
+
* @param value - Password candidate.
|
|
365
|
+
* @param options - Validation options.
|
|
366
|
+
* @returns `true` when the value is valid.
|
|
367
|
+
*/
|
|
368
|
+
export function isStrongPassword(value, options = {}) {
|
|
369
|
+
return validateStrongPassword(value, options).ok;
|
|
370
|
+
}
|
|
371
|
+
function luhnCheck(value) {
|
|
372
|
+
let sum = 0;
|
|
373
|
+
let shouldDouble = false;
|
|
374
|
+
for (let index = value.length - 1; index >= 0; index -= 1) {
|
|
375
|
+
let digit = Number(value[index]);
|
|
376
|
+
if (shouldDouble) {
|
|
377
|
+
digit *= 2;
|
|
378
|
+
if (digit > 9) {
|
|
379
|
+
digit -= 9;
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
sum += digit;
|
|
383
|
+
shouldDouble = !shouldDouble;
|
|
384
|
+
}
|
|
385
|
+
return sum % 10 === 0;
|
|
386
|
+
}
|
|
387
|
+
/**
|
|
388
|
+
* Validates card numbers using basic shape checks plus Luhn checksum.
|
|
389
|
+
*
|
|
390
|
+
* @param value - Card number candidate.
|
|
391
|
+
* @returns Structured validation result.
|
|
392
|
+
*/
|
|
393
|
+
export function validateCreditCardNumber(value) {
|
|
394
|
+
const normalized = value.replace(/[\s-]/g, "");
|
|
395
|
+
if (!normalized) {
|
|
396
|
+
return fail("EMPTY", "Card number cannot be empty.");
|
|
397
|
+
}
|
|
398
|
+
if (!/^\d{12,19}$/.test(normalized)) {
|
|
399
|
+
return fail("INVALID_FORMAT", "Card number must contain only digits and valid length.");
|
|
400
|
+
}
|
|
401
|
+
if (!luhnCheck(normalized)) {
|
|
402
|
+
return fail("CHECKSUM_FAILED", "Card number checksum is invalid.");
|
|
403
|
+
}
|
|
404
|
+
return ok("Valid card number.");
|
|
405
|
+
}
|
|
406
|
+
/**
|
|
407
|
+
* Boolean wrapper for `validateCreditCardNumber`.
|
|
408
|
+
*
|
|
409
|
+
* @param value - Card number candidate.
|
|
410
|
+
* @returns `true` when the card number is valid.
|
|
411
|
+
*/
|
|
412
|
+
export function isCreditCardNumber(value) {
|
|
413
|
+
return validateCreditCardNumber(value).ok;
|
|
119
414
|
}
|
|
120
415
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAoBA,MAAM,kBAAkB,GAAiD;IACvE,EAAE,EAAE,IAAI,GAAG,CAAC;QACV,GAAG;QACH,GAAG;QACH,GAAG;QACH,GAAG;QACH,IAAI;QACJ,IAAI;QACJ,IAAI;QACJ,IAAI;QACJ,OAAO;QACP,OAAO;QACP,MAAM;QACN,MAAM;QACN,WAAW;QACX,WAAW;QACX,WAAW;QACX,WAAW;KACZ,CAAC;IACF,EAAE,EAAE,IAAI,GAAG,CAAC;QACV,GAAG;QACH,GAAG;QACH,GAAG;QACH,GAAG;QACH,IAAI;QACJ,IAAI;QACJ,IAAI;QACJ,IAAI;QACJ,OAAO;QACP,KAAK;QACL,MAAM;QACN,OAAO;QACP,SAAS;QACT,UAAU;QACV,SAAS;QACT,UAAU;KACX,CAAC;CACH,CAAC;AAEF,MAAM,aAAa,GAAuF;IACxG,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE;IACpC,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE;IACpC,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE;IACpC,EAAE,EAAE,EAAE,SAAS,EAAE,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE;CACpC,CAAC;AAEF,SAAS,EAAE,CAAC,OAAO,GAAG,oBAAoB;IACxC,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;AAC9C,CAAC;AAED,SAAS,IAAI,CAAC,IAA4C,EAAE,OAAe;IACzE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AACtC,CAAC;A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
-
"sideEffects": false,
|
|
8
|
-
"main": "./dist/cjs/index.cjs",
|
|
9
|
-
"module": "./dist/esm/index.js",
|
|
10
|
-
"types": "./dist/esm/index.d.ts",
|
|
11
|
-
"exports": {
|
|
12
|
-
".": {
|
|
13
|
-
"types": "./dist/esm/index.d.ts",
|
|
14
|
-
"import": "./dist/esm/index.js",
|
|
15
|
-
"require": "./dist/cjs/index.cjs"
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
"files": [
|
|
19
|
-
"dist",
|
|
20
|
-
"README.md"
|
|
21
|
-
],
|
|
22
|
-
"scripts": {
|
|
23
|
-
"build": "npm run clean && npm run build:esm && npm run build:cjs",
|
|
24
|
-
"build:esm": "tsc -p tsconfig.esm.json",
|
|
25
|
-
"build:cjs": "tsc -p tsconfig.cjs.json && node ./scripts/rename-cjs.mjs",
|
|
26
|
-
"clean": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\"",
|
|
27
|
-
"test": "npm run build && node --test test/*.test.mjs",
|
|
28
|
-
"lint": "node -e \"console.log('No lint configured for @jdsalasc/solvejs-validators')\""
|
|
29
|
-
},
|
|
30
|
-
"publishConfig": {
|
|
31
|
-
"access": "public"
|
|
32
|
-
},
|
|
33
|
-
"author": "jdsalasc",
|
|
34
|
-
"homepage": "https://github.com/jdsalasca/solvejs#readme",
|
|
35
|
-
"repository": {
|
|
36
|
-
"type": "git",
|
|
37
|
-
"url": "git+https://github.com/jdsalasca/solvejs.git"
|
|
38
|
-
},
|
|
39
|
-
"bugs": {
|
|
40
|
-
"url": "https://github.com/jdsalasca/solvejs/issues"
|
|
41
|
-
},
|
|
42
|
-
"engines": {
|
|
43
|
-
"node": ">=18"
|
|
44
|
-
},
|
|
45
|
-
"keywords": [
|
|
46
|
-
"validators",
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
|
|
52
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@jdsalasc/solvejs-validators",
|
|
3
|
+
"version": "1.2.0",
|
|
4
|
+
"description": "Zero-dependency validators for JS/TS forms with structured result codes and region-aware checks.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"sideEffects": false,
|
|
8
|
+
"main": "./dist/cjs/index.cjs",
|
|
9
|
+
"module": "./dist/esm/index.js",
|
|
10
|
+
"types": "./dist/esm/index.d.ts",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./dist/esm/index.d.ts",
|
|
14
|
+
"import": "./dist/esm/index.js",
|
|
15
|
+
"require": "./dist/cjs/index.cjs"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"dist",
|
|
20
|
+
"README.md"
|
|
21
|
+
],
|
|
22
|
+
"scripts": {
|
|
23
|
+
"build": "npm run clean && npm run build:esm && npm run build:cjs",
|
|
24
|
+
"build:esm": "tsc -p tsconfig.esm.json",
|
|
25
|
+
"build:cjs": "tsc -p tsconfig.cjs.json && node ./scripts/rename-cjs.mjs",
|
|
26
|
+
"clean": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\"",
|
|
27
|
+
"test": "npm run build && node --test test/*.test.mjs",
|
|
28
|
+
"lint": "node -e \"console.log('No lint configured for @jdsalasc/solvejs-validators')\""
|
|
29
|
+
},
|
|
30
|
+
"publishConfig": {
|
|
31
|
+
"access": "public"
|
|
32
|
+
},
|
|
33
|
+
"author": "jdsalasc",
|
|
34
|
+
"homepage": "https://github.com/jdsalasca/solvejs#readme",
|
|
35
|
+
"repository": {
|
|
36
|
+
"type": "git",
|
|
37
|
+
"url": "git+https://github.com/jdsalasca/solvejs.git"
|
|
38
|
+
},
|
|
39
|
+
"bugs": {
|
|
40
|
+
"url": "https://github.com/jdsalasca/solvejs/issues"
|
|
41
|
+
},
|
|
42
|
+
"engines": {
|
|
43
|
+
"node": ">=18"
|
|
44
|
+
},
|
|
45
|
+
"keywords": [
|
|
46
|
+
"validators",
|
|
47
|
+
"form validation",
|
|
48
|
+
"cellphone validation",
|
|
49
|
+
"credit card luhn",
|
|
50
|
+
"username validation",
|
|
51
|
+
"typescript validation",
|
|
52
|
+
"solvejs"
|
|
53
|
+
]
|
|
54
|
+
}
|