valgen 5.15.2 → 5.15.4
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/CHANGELOG.md +13 -1
- package/cjs/index.js +68 -64
- package/cjs/rules/utility-rules/required.js +3 -1
- package/esm/index.js +34 -32
- package/esm/rules/utility-rules/required.js +3 -1
- package/package.json +1 -1
- package/types/index.d.cts +34 -32
- package/types/index.d.ts +34 -32
- package/types/rules/utility-rules/required.d.ts +5 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
## Changelog
|
|
2
2
|
|
|
3
|
-
### [v5.15.
|
|
3
|
+
### [v5.15.4](https://github.com/panates/valgen/compare/v5.15.3...v5.15.4) -
|
|
4
|
+
|
|
5
|
+
#### 🛠 Refactoring and Updates
|
|
6
|
+
|
|
7
|
+
- refactor: Exported default isTime rule @Eray Hanoğlu
|
|
8
|
+
|
|
9
|
+
### [v5.15.3](https://github.com/panates/valgen/compare/v5.15.2...v5.15.3) - 20 June 2025
|
|
10
|
+
|
|
11
|
+
#### 🚀 New Features
|
|
12
|
+
|
|
13
|
+
- feat: Adde default value option to "required" rule @Eray Hanoğlu
|
|
14
|
+
|
|
15
|
+
### [v5.15.2](https://github.com/panates/valgen/compare/v5.15.1...v5.15.2) - 27 May 2025
|
|
4
16
|
|
|
5
17
|
#### 🛠 Refactoring and Updates
|
|
6
18
|
|
package/cjs/index.js
CHANGED
|
@@ -1,50 +1,102 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.vg = exports.toString = exports.toNumber = exports.toInteger = exports.toDateString = exports.toDate = exports.toBoolean = exports.toBigint = exports.toArray = void 0;
|
|
3
|
+
exports.isUUID4 = exports.isUUID3 = exports.isUUID2 = exports.isUUID1 = exports.isUUID = exports.isURL = exports.isUppercase = exports.isUndefined = exports.isTime = exports.isSWIFT = exports.isString = exports.isPort = exports.isObjectId = exports.isObject = exports.isNumber = exports.isNullish = exports.isNull = exports.isNotNullish = exports.isNotNull = exports.isNotEmpty = exports.isMobilePhone = exports.isMACAddress = exports.isLowercase = exports.isJWT = exports.isISSN = exports.isIPRange = exports.isIP = exports.isInteger = exports.isIBAN = exports.isHexColor = exports.isHex = exports.isFQDN = exports.isETHAddress = exports.isEmpty = exports.isEmail = exports.isEAN = exports.isDefined = exports.isDecimal = exports.isDateString = exports.isDate = exports.isCreditCard = exports.isBtcAddress = exports.isBoolean = exports.isBigint = exports.isBase64 = exports.isAscii = exports.isArray = exports.isAny = exports.isAlphanumeric = exports.isAlpha = void 0;
|
|
4
|
+
exports.vg = exports.toTime = exports.toString = exports.toNumber = exports.toInteger = exports.toDateString = exports.toDate = exports.toBoolean = exports.toBigint = exports.toArray = exports.isUUID5 = void 0;
|
|
5
5
|
const tslib_1 = require("tslib");
|
|
6
6
|
const vg = tslib_1.__importStar(require("./rules/index.js"));
|
|
7
7
|
exports.vg = vg;
|
|
8
8
|
tslib_1.__exportStar(require("./constants.js"), exports);
|
|
9
9
|
tslib_1.__exportStar(require("./core/index.js"), exports);
|
|
10
|
+
const isAlpha = vg.isAlpha();
|
|
11
|
+
exports.isAlpha = isAlpha;
|
|
12
|
+
const isAlphanumeric = vg.isAlphanumeric();
|
|
13
|
+
exports.isAlphanumeric = isAlphanumeric;
|
|
10
14
|
const isAny = vg.isAny();
|
|
11
15
|
exports.isAny = isAny;
|
|
12
16
|
const isArray = vg.isArray();
|
|
13
17
|
exports.isArray = isArray;
|
|
18
|
+
const isAscii = vg.isAscii();
|
|
19
|
+
exports.isAscii = isAscii;
|
|
20
|
+
const isBase64 = vg.isBase64();
|
|
21
|
+
exports.isBase64 = isBase64;
|
|
14
22
|
const isBigint = vg.isBigint();
|
|
15
23
|
exports.isBigint = isBigint;
|
|
16
24
|
const isBoolean = vg.isBoolean();
|
|
17
25
|
exports.isBoolean = isBoolean;
|
|
26
|
+
const isBtcAddress = vg.isBtcAddress();
|
|
27
|
+
exports.isBtcAddress = isBtcAddress;
|
|
28
|
+
const isCreditCard = vg.isCreditCard();
|
|
29
|
+
exports.isCreditCard = isCreditCard;
|
|
18
30
|
const isDate = vg.isDate();
|
|
19
31
|
exports.isDate = isDate;
|
|
20
32
|
const isDateString = vg.isDateString();
|
|
21
33
|
exports.isDateString = isDateString;
|
|
34
|
+
const isDecimal = vg.isDecimal();
|
|
35
|
+
exports.isDecimal = isDecimal;
|
|
36
|
+
const isDefined = vg.isDefined();
|
|
37
|
+
exports.isDefined = isDefined;
|
|
38
|
+
const isEAN = vg.isEAN();
|
|
39
|
+
exports.isEAN = isEAN;
|
|
40
|
+
const isEmail = vg.isEmail();
|
|
41
|
+
exports.isEmail = isEmail;
|
|
22
42
|
const isEmpty = vg.isEmpty();
|
|
23
43
|
exports.isEmpty = isEmpty;
|
|
24
|
-
const
|
|
25
|
-
exports.
|
|
44
|
+
const isETHAddress = vg.isETHAddress();
|
|
45
|
+
exports.isETHAddress = isETHAddress;
|
|
46
|
+
const isFQDN = vg.isFQDN();
|
|
47
|
+
exports.isFQDN = isFQDN;
|
|
48
|
+
const isHex = vg.isHex();
|
|
49
|
+
exports.isHex = isHex;
|
|
50
|
+
const isHexColor = vg.isHexColor();
|
|
51
|
+
exports.isHexColor = isHexColor;
|
|
52
|
+
const isIBAN = vg.isIBAN();
|
|
53
|
+
exports.isIBAN = isIBAN;
|
|
26
54
|
const isInteger = vg.isInteger();
|
|
27
55
|
exports.isInteger = isInteger;
|
|
28
|
-
const
|
|
29
|
-
exports.
|
|
56
|
+
const isIP = vg.isIP();
|
|
57
|
+
exports.isIP = isIP;
|
|
58
|
+
const isIPRange = vg.isIPRange();
|
|
59
|
+
exports.isIPRange = isIPRange;
|
|
60
|
+
const isISSN = vg.isISSN();
|
|
61
|
+
exports.isISSN = isISSN;
|
|
62
|
+
const isJWT = vg.isJWT();
|
|
63
|
+
exports.isJWT = isJWT;
|
|
64
|
+
const isLowercase = vg.isLowercase();
|
|
65
|
+
exports.isLowercase = isLowercase;
|
|
66
|
+
const isMACAddress = vg.isMACAddress();
|
|
67
|
+
exports.isMACAddress = isMACAddress;
|
|
68
|
+
const isMobilePhone = vg.isMobilePhone();
|
|
69
|
+
exports.isMobilePhone = isMobilePhone;
|
|
70
|
+
const isNotEmpty = vg.isNotEmpty();
|
|
71
|
+
exports.isNotEmpty = isNotEmpty;
|
|
30
72
|
const isNotNull = vg.isNotNull();
|
|
31
73
|
exports.isNotNull = isNotNull;
|
|
32
|
-
const isNullish = vg.isNullish();
|
|
33
|
-
exports.isNullish = isNullish;
|
|
34
74
|
const isNotNullish = vg.isNotNullish();
|
|
35
75
|
exports.isNotNullish = isNotNullish;
|
|
36
|
-
const
|
|
37
|
-
exports.
|
|
38
|
-
const
|
|
39
|
-
exports.
|
|
76
|
+
const isNull = vg.isNull();
|
|
77
|
+
exports.isNull = isNull;
|
|
78
|
+
const isNullish = vg.isNullish();
|
|
79
|
+
exports.isNullish = isNullish;
|
|
40
80
|
const isNumber = vg.isNumber();
|
|
41
81
|
exports.isNumber = isNumber;
|
|
42
82
|
const isObject = vg.isObject();
|
|
43
83
|
exports.isObject = isObject;
|
|
44
84
|
const isObjectId = vg.isObjectId();
|
|
45
85
|
exports.isObjectId = isObjectId;
|
|
86
|
+
const isPort = vg.isPort();
|
|
87
|
+
exports.isPort = isPort;
|
|
46
88
|
const isString = vg.isString();
|
|
47
89
|
exports.isString = isString;
|
|
90
|
+
const isSWIFT = vg.isSWIFT();
|
|
91
|
+
exports.isSWIFT = isSWIFT;
|
|
92
|
+
const isTime = vg.isTime();
|
|
93
|
+
exports.isTime = isTime;
|
|
94
|
+
const isUndefined = vg.isUndefined();
|
|
95
|
+
exports.isUndefined = isUndefined;
|
|
96
|
+
const isUppercase = vg.isUppercase();
|
|
97
|
+
exports.isUppercase = isUppercase;
|
|
98
|
+
const isURL = vg.isURL();
|
|
99
|
+
exports.isURL = isURL;
|
|
48
100
|
const isUUID = vg.isUUID();
|
|
49
101
|
exports.isUUID = isUUID;
|
|
50
102
|
const isUUID1 = vg.isUUID(1);
|
|
@@ -57,64 +109,14 @@ const isUUID4 = vg.isUUID(4);
|
|
|
57
109
|
exports.isUUID4 = isUUID4;
|
|
58
110
|
const isUUID5 = vg.isUUID(5);
|
|
59
111
|
exports.isUUID5 = isUUID5;
|
|
60
|
-
const isEmail = vg.isEmail();
|
|
61
|
-
exports.isEmail = isEmail;
|
|
62
|
-
const isMobilePhone = vg.isMobilePhone();
|
|
63
|
-
exports.isMobilePhone = isMobilePhone;
|
|
64
|
-
const isIP = vg.isIP();
|
|
65
|
-
exports.isIP = isIP;
|
|
66
|
-
const isIPRange = vg.isIPRange();
|
|
67
|
-
exports.isIPRange = isIPRange;
|
|
68
|
-
const isMACAddress = vg.isMACAddress();
|
|
69
|
-
exports.isMACAddress = isMACAddress;
|
|
70
|
-
const isPort = vg.isPort();
|
|
71
|
-
exports.isPort = isPort;
|
|
72
|
-
const isURL = vg.isURL();
|
|
73
|
-
exports.isURL = isURL;
|
|
74
|
-
const isBase64 = vg.isBase64();
|
|
75
|
-
exports.isBase64 = isBase64;
|
|
76
|
-
const isSWIFT = vg.isSWIFT();
|
|
77
|
-
exports.isSWIFT = isSWIFT;
|
|
78
|
-
const isCreditCard = vg.isCreditCard();
|
|
79
|
-
exports.isCreditCard = isCreditCard;
|
|
80
|
-
const isIBAN = vg.isIBAN();
|
|
81
|
-
exports.isIBAN = isIBAN;
|
|
82
|
-
const isEAN = vg.isEAN();
|
|
83
|
-
exports.isEAN = isEAN;
|
|
84
|
-
const isFQDN = vg.isFQDN();
|
|
85
|
-
exports.isFQDN = isFQDN;
|
|
86
|
-
const isISSN = vg.isISSN();
|
|
87
|
-
exports.isISSN = isISSN;
|
|
88
|
-
const isBtcAddress = vg.isBtcAddress();
|
|
89
|
-
exports.isBtcAddress = isBtcAddress;
|
|
90
|
-
const isETHAddress = vg.isETHAddress();
|
|
91
|
-
exports.isETHAddress = isETHAddress;
|
|
92
|
-
const isHexColor = vg.isHexColor();
|
|
93
|
-
exports.isHexColor = isHexColor;
|
|
94
|
-
const isJWT = vg.isJWT();
|
|
95
|
-
exports.isJWT = isJWT;
|
|
96
|
-
const isLowercase = vg.isLowercase();
|
|
97
|
-
exports.isLowercase = isLowercase;
|
|
98
|
-
const isUppercase = vg.isUppercase();
|
|
99
|
-
exports.isUppercase = isUppercase;
|
|
100
|
-
const isAlpha = vg.isAlpha();
|
|
101
|
-
exports.isAlpha = isAlpha;
|
|
102
|
-
const isAlphanumeric = vg.isAlphanumeric();
|
|
103
|
-
exports.isAlphanumeric = isAlphanumeric;
|
|
104
|
-
const isAscii = vg.isAscii();
|
|
105
|
-
exports.isAscii = isAscii;
|
|
106
|
-
const isDecimal = vg.isDecimal();
|
|
107
|
-
exports.isDecimal = isDecimal;
|
|
108
|
-
const isHex = vg.isHex();
|
|
109
|
-
exports.isHex = isHex;
|
|
110
112
|
const toArray = vg.isArray(isAny, { coerce: true });
|
|
111
113
|
exports.toArray = toArray;
|
|
114
|
+
const toBigint = vg.isBigint({ coerce: true });
|
|
115
|
+
exports.toBigint = toBigint;
|
|
112
116
|
const toBoolean = vg.isBoolean({ coerce: true });
|
|
113
117
|
exports.toBoolean = toBoolean;
|
|
114
118
|
const toDate = vg.isDate({ coerce: true });
|
|
115
119
|
exports.toDate = toDate;
|
|
116
|
-
const toBigint = vg.isBigint({ coerce: true });
|
|
117
|
-
exports.toBigint = toBigint;
|
|
118
120
|
const toDateString = vg.isDateString({ coerce: true });
|
|
119
121
|
exports.toDateString = toDateString;
|
|
120
122
|
const toInteger = vg.isInteger({ coerce: true });
|
|
@@ -123,3 +125,5 @@ const toNumber = vg.isNumber({ coerce: true });
|
|
|
123
125
|
exports.toNumber = toNumber;
|
|
124
126
|
const toString = vg.isString({ coerce: true });
|
|
125
127
|
exports.toString = toString;
|
|
128
|
+
const toTime = vg.isTime({ coerce: true });
|
|
129
|
+
exports.toTime = toTime;
|
|
@@ -3,11 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.required = required;
|
|
4
4
|
const index_js_1 = require("../../core/index.js");
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Check if value is not nullish before calling nested rule
|
|
7
7
|
* @validator required
|
|
8
8
|
*/
|
|
9
9
|
function required(nested, options) {
|
|
10
10
|
return (0, index_js_1.validator)('required', (input, context, _this) => {
|
|
11
|
+
if (input == null)
|
|
12
|
+
input = options?.default;
|
|
11
13
|
if (input == null) {
|
|
12
14
|
context.fail(_this, `Value required`, input);
|
|
13
15
|
return;
|
package/esm/index.js
CHANGED
|
@@ -1,62 +1,64 @@
|
|
|
1
1
|
import * as vg from './rules/index.js';
|
|
2
2
|
export * from './constants.js';
|
|
3
3
|
export * from './core/index.js';
|
|
4
|
+
const isAlpha = vg.isAlpha();
|
|
5
|
+
const isAlphanumeric = vg.isAlphanumeric();
|
|
4
6
|
const isAny = vg.isAny();
|
|
5
7
|
const isArray = vg.isArray();
|
|
8
|
+
const isAscii = vg.isAscii();
|
|
9
|
+
const isBase64 = vg.isBase64();
|
|
6
10
|
const isBigint = vg.isBigint();
|
|
7
11
|
const isBoolean = vg.isBoolean();
|
|
12
|
+
const isBtcAddress = vg.isBtcAddress();
|
|
13
|
+
const isCreditCard = vg.isCreditCard();
|
|
8
14
|
const isDate = vg.isDate();
|
|
9
15
|
const isDateString = vg.isDateString();
|
|
16
|
+
const isDecimal = vg.isDecimal();
|
|
17
|
+
const isDefined = vg.isDefined();
|
|
18
|
+
const isEAN = vg.isEAN();
|
|
19
|
+
const isEmail = vg.isEmail();
|
|
10
20
|
const isEmpty = vg.isEmpty();
|
|
11
|
-
const
|
|
21
|
+
const isETHAddress = vg.isETHAddress();
|
|
22
|
+
const isFQDN = vg.isFQDN();
|
|
23
|
+
const isHex = vg.isHex();
|
|
24
|
+
const isHexColor = vg.isHexColor();
|
|
25
|
+
const isIBAN = vg.isIBAN();
|
|
12
26
|
const isInteger = vg.isInteger();
|
|
13
|
-
const
|
|
27
|
+
const isIP = vg.isIP();
|
|
28
|
+
const isIPRange = vg.isIPRange();
|
|
29
|
+
const isISSN = vg.isISSN();
|
|
30
|
+
const isJWT = vg.isJWT();
|
|
31
|
+
const isLowercase = vg.isLowercase();
|
|
32
|
+
const isMACAddress = vg.isMACAddress();
|
|
33
|
+
const isMobilePhone = vg.isMobilePhone();
|
|
34
|
+
const isNotEmpty = vg.isNotEmpty();
|
|
14
35
|
const isNotNull = vg.isNotNull();
|
|
15
|
-
const isNullish = vg.isNullish();
|
|
16
36
|
const isNotNullish = vg.isNotNullish();
|
|
17
|
-
const
|
|
18
|
-
const
|
|
37
|
+
const isNull = vg.isNull();
|
|
38
|
+
const isNullish = vg.isNullish();
|
|
19
39
|
const isNumber = vg.isNumber();
|
|
20
40
|
const isObject = vg.isObject();
|
|
21
41
|
const isObjectId = vg.isObjectId();
|
|
42
|
+
const isPort = vg.isPort();
|
|
22
43
|
const isString = vg.isString();
|
|
44
|
+
const isSWIFT = vg.isSWIFT();
|
|
45
|
+
const isTime = vg.isTime();
|
|
46
|
+
const isUndefined = vg.isUndefined();
|
|
47
|
+
const isUppercase = vg.isUppercase();
|
|
48
|
+
const isURL = vg.isURL();
|
|
23
49
|
const isUUID = vg.isUUID();
|
|
24
50
|
const isUUID1 = vg.isUUID(1);
|
|
25
51
|
const isUUID2 = vg.isUUID(2);
|
|
26
52
|
const isUUID3 = vg.isUUID(3);
|
|
27
53
|
const isUUID4 = vg.isUUID(4);
|
|
28
54
|
const isUUID5 = vg.isUUID(5);
|
|
29
|
-
const isEmail = vg.isEmail();
|
|
30
|
-
const isMobilePhone = vg.isMobilePhone();
|
|
31
|
-
const isIP = vg.isIP();
|
|
32
|
-
const isIPRange = vg.isIPRange();
|
|
33
|
-
const isMACAddress = vg.isMACAddress();
|
|
34
|
-
const isPort = vg.isPort();
|
|
35
|
-
const isURL = vg.isURL();
|
|
36
|
-
const isBase64 = vg.isBase64();
|
|
37
|
-
const isSWIFT = vg.isSWIFT();
|
|
38
|
-
const isCreditCard = vg.isCreditCard();
|
|
39
|
-
const isIBAN = vg.isIBAN();
|
|
40
|
-
const isEAN = vg.isEAN();
|
|
41
|
-
const isFQDN = vg.isFQDN();
|
|
42
|
-
const isISSN = vg.isISSN();
|
|
43
|
-
const isBtcAddress = vg.isBtcAddress();
|
|
44
|
-
const isETHAddress = vg.isETHAddress();
|
|
45
|
-
const isHexColor = vg.isHexColor();
|
|
46
|
-
const isJWT = vg.isJWT();
|
|
47
|
-
const isLowercase = vg.isLowercase();
|
|
48
|
-
const isUppercase = vg.isUppercase();
|
|
49
|
-
const isAlpha = vg.isAlpha();
|
|
50
|
-
const isAlphanumeric = vg.isAlphanumeric();
|
|
51
|
-
const isAscii = vg.isAscii();
|
|
52
|
-
const isDecimal = vg.isDecimal();
|
|
53
|
-
const isHex = vg.isHex();
|
|
54
55
|
const toArray = vg.isArray(isAny, { coerce: true });
|
|
56
|
+
const toBigint = vg.isBigint({ coerce: true });
|
|
55
57
|
const toBoolean = vg.isBoolean({ coerce: true });
|
|
56
58
|
const toDate = vg.isDate({ coerce: true });
|
|
57
|
-
const toBigint = vg.isBigint({ coerce: true });
|
|
58
59
|
const toDateString = vg.isDateString({ coerce: true });
|
|
59
60
|
const toInteger = vg.isInteger({ coerce: true });
|
|
60
61
|
const toNumber = vg.isNumber({ coerce: true });
|
|
61
62
|
const toString = vg.isString({ coerce: true });
|
|
62
|
-
|
|
63
|
+
const toTime = vg.isTime({ coerce: true });
|
|
64
|
+
export { isAlpha, isAlphanumeric, isAny, isArray, isAscii, isBase64, isBigint, isBoolean, isBtcAddress, isCreditCard, isDate, isDateString, isDecimal, isDefined, isEAN, isEmail, isEmpty, isETHAddress, isFQDN, isHex, isHexColor, isIBAN, isInteger, isIP, isIPRange, isISSN, isJWT, isLowercase, isMACAddress, isMobilePhone, isNotEmpty, isNotNull, isNotNullish, isNull, isNullish, isNumber, isObject, isObjectId, isPort, isString, isSWIFT, isTime, isUndefined, isUppercase, isURL, isUUID, isUUID1, isUUID2, isUUID3, isUUID4, isUUID5, toArray, toBigint, toBoolean, toDate, toDateString, toInteger, toNumber, toString, toTime, vg, };
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { validator, } from '../../core/index.js';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Check if value is not nullish before calling nested rule
|
|
4
4
|
* @validator required
|
|
5
5
|
*/
|
|
6
6
|
export function required(nested, options) {
|
|
7
7
|
return validator('required', (input, context, _this) => {
|
|
8
|
+
if (input == null)
|
|
9
|
+
input = options?.default;
|
|
8
10
|
if (input == null) {
|
|
9
11
|
context.fail(_this, `Value required`, input);
|
|
10
12
|
return;
|
package/package.json
CHANGED
package/types/index.d.cts
CHANGED
|
@@ -2,62 +2,64 @@ import * as vg from './rules/index.js';
|
|
|
2
2
|
export * from './constants.js';
|
|
3
3
|
export * from './core/index.js';
|
|
4
4
|
export type { IsObject } from './rules/type-rules/is-object.js';
|
|
5
|
+
declare const isAlpha: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
6
|
+
declare const isAlphanumeric: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
5
7
|
declare const isAny: import("./core/validator.js").Validator<any, any, import("./core/types.js").ExecutionOptions>;
|
|
6
8
|
declare const isArray: import("./core/validator.js").Validator<unknown[], unknown, import("./core/types.js").ExecutionOptions>;
|
|
9
|
+
declare const isAscii: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
10
|
+
declare const isBase64: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
7
11
|
declare const isBigint: import("./core/validator.js").Validator<bigint, unknown, import("./core/types.js").ExecutionOptions>;
|
|
8
12
|
declare const isBoolean: import("./core/validator.js").Validator<boolean | undefined, unknown, import("./core/types.js").ExecutionOptions>;
|
|
13
|
+
declare const isBtcAddress: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
14
|
+
declare const isCreditCard: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
9
15
|
declare const isDate: import("./core/validator.js").Validator<Date, string | number | Date, import("./core/types.js").ExecutionOptions>;
|
|
10
16
|
declare const isDateString: import("./core/validator.js").Validator<string, string | number | Date, import("./core/types.js").ExecutionOptions>;
|
|
17
|
+
declare const isDecimal: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
18
|
+
declare const isDefined: import("./core/validator.js").Validator<any, unknown, import("./core/types.js").ExecutionOptions>;
|
|
19
|
+
declare const isEAN: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
20
|
+
declare const isEmail: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
11
21
|
declare const isEmpty: import("./core/validator.js").Validator<any, any, import("./core/types.js").ExecutionOptions>;
|
|
12
|
-
declare const
|
|
22
|
+
declare const isETHAddress: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
23
|
+
declare const isFQDN: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
24
|
+
declare const isHex: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
25
|
+
declare const isHexColor: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
26
|
+
declare const isIBAN: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
13
27
|
declare const isInteger: import("./core/validator.js").Validator<number, unknown, import("./core/types.js").ExecutionOptions>;
|
|
14
|
-
declare const
|
|
28
|
+
declare const isIP: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
29
|
+
declare const isIPRange: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
30
|
+
declare const isISSN: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
31
|
+
declare const isJWT: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
32
|
+
declare const isLowercase: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
33
|
+
declare const isMACAddress: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
34
|
+
declare const isMobilePhone: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
35
|
+
declare const isNotEmpty: import("./core/validator.js").Validator<any, any, import("./core/types.js").ExecutionOptions>;
|
|
15
36
|
declare const isNotNull: import("./core/validator.js").Validator<unknown, unknown, import("./core/types.js").ExecutionOptions>;
|
|
16
|
-
declare const isNullish: import("./core/validator.js").Validator<null, unknown, import("./core/types.js").ExecutionOptions>;
|
|
17
37
|
declare const isNotNullish: import("./core/validator.js").Validator<unknown, unknown, import("./core/types.js").ExecutionOptions>;
|
|
18
|
-
declare const
|
|
19
|
-
declare const
|
|
38
|
+
declare const isNull: import("./core/validator.js").Validator<null, unknown, import("./core/types.js").ExecutionOptions>;
|
|
39
|
+
declare const isNullish: import("./core/validator.js").Validator<null, unknown, import("./core/types.js").ExecutionOptions>;
|
|
20
40
|
declare const isNumber: import("./core/validator.js").Validator<number, unknown, import("./core/types.js").ExecutionOptions>;
|
|
21
41
|
declare const isObject: vg.IsObject.Validator<object, string | object>;
|
|
22
42
|
declare const isObjectId: import("./core/validator.js").Validator<string | vg.ObjectIdLike | Uint8Array<ArrayBufferLike>, unknown, import("./core/types.js").ExecutionOptions>;
|
|
43
|
+
declare const isPort: import("./core/validator.js").Validator<number, string | number, import("./core/types.js").ExecutionOptions>;
|
|
23
44
|
declare const isString: import("./core/validator.js").Validator<string, unknown, import("./core/types.js").ExecutionOptions>;
|
|
45
|
+
declare const isSWIFT: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
46
|
+
declare const isTime: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
47
|
+
declare const isUndefined: import("./core/validator.js").Validator<any, unknown, import("./core/types.js").ExecutionOptions>;
|
|
48
|
+
declare const isUppercase: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
49
|
+
declare const isURL: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
24
50
|
declare const isUUID: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
25
51
|
declare const isUUID1: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
26
52
|
declare const isUUID2: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
27
53
|
declare const isUUID3: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
28
54
|
declare const isUUID4: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
29
55
|
declare const isUUID5: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
30
|
-
declare const isEmail: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
31
|
-
declare const isMobilePhone: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
32
|
-
declare const isIP: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
33
|
-
declare const isIPRange: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
34
|
-
declare const isMACAddress: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
35
|
-
declare const isPort: import("./core/validator.js").Validator<number, string | number, import("./core/types.js").ExecutionOptions>;
|
|
36
|
-
declare const isURL: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
37
|
-
declare const isBase64: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
38
|
-
declare const isSWIFT: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
39
|
-
declare const isCreditCard: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
40
|
-
declare const isIBAN: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
41
|
-
declare const isEAN: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
42
|
-
declare const isFQDN: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
43
|
-
declare const isISSN: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
44
|
-
declare const isBtcAddress: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
45
|
-
declare const isETHAddress: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
46
|
-
declare const isHexColor: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
47
|
-
declare const isJWT: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
48
|
-
declare const isLowercase: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
49
|
-
declare const isUppercase: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
50
|
-
declare const isAlpha: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
51
|
-
declare const isAlphanumeric: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
52
|
-
declare const isAscii: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
53
|
-
declare const isDecimal: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
54
|
-
declare const isHex: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
55
56
|
declare const toArray: import("./core/validator.js").Validator<any[], any, import("./core/types.js").ExecutionOptions>;
|
|
57
|
+
declare const toBigint: import("./core/validator.js").Validator<bigint, unknown, import("./core/types.js").ExecutionOptions>;
|
|
56
58
|
declare const toBoolean: import("./core/validator.js").Validator<boolean | undefined, unknown, import("./core/types.js").ExecutionOptions>;
|
|
57
59
|
declare const toDate: import("./core/validator.js").Validator<Date, string | number | Date, import("./core/types.js").ExecutionOptions>;
|
|
58
|
-
declare const toBigint: import("./core/validator.js").Validator<bigint, unknown, import("./core/types.js").ExecutionOptions>;
|
|
59
60
|
declare const toDateString: import("./core/validator.js").Validator<string, string | number | Date, import("./core/types.js").ExecutionOptions>;
|
|
60
61
|
declare const toInteger: import("./core/validator.js").Validator<number, unknown, import("./core/types.js").ExecutionOptions>;
|
|
61
62
|
declare const toNumber: import("./core/validator.js").Validator<number, unknown, import("./core/types.js").ExecutionOptions>;
|
|
62
63
|
declare const toString: import("./core/validator.js").Validator<string, unknown, import("./core/types.js").ExecutionOptions>;
|
|
63
|
-
|
|
64
|
+
declare const toTime: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
65
|
+
export { isAlpha, isAlphanumeric, isAny, isArray, isAscii, isBase64, isBigint, isBoolean, isBtcAddress, isCreditCard, isDate, isDateString, isDecimal, isDefined, isEAN, isEmail, isEmpty, isETHAddress, isFQDN, isHex, isHexColor, isIBAN, isInteger, isIP, isIPRange, isISSN, isJWT, isLowercase, isMACAddress, isMobilePhone, isNotEmpty, isNotNull, isNotNullish, isNull, isNullish, isNumber, isObject, isObjectId, isPort, isString, isSWIFT, isTime, isUndefined, isUppercase, isURL, isUUID, isUUID1, isUUID2, isUUID3, isUUID4, isUUID5, toArray, toBigint, toBoolean, toDate, toDateString, toInteger, toNumber, toString, toTime, vg, };
|
package/types/index.d.ts
CHANGED
|
@@ -2,62 +2,64 @@ import * as vg from './rules/index.js';
|
|
|
2
2
|
export * from './constants.js';
|
|
3
3
|
export * from './core/index.js';
|
|
4
4
|
export type { IsObject } from './rules/type-rules/is-object.js';
|
|
5
|
+
declare const isAlpha: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
6
|
+
declare const isAlphanumeric: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
5
7
|
declare const isAny: import("./core/validator.js").Validator<any, any, import("./core/types.js").ExecutionOptions>;
|
|
6
8
|
declare const isArray: import("./core/validator.js").Validator<unknown[], unknown, import("./core/types.js").ExecutionOptions>;
|
|
9
|
+
declare const isAscii: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
10
|
+
declare const isBase64: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
7
11
|
declare const isBigint: import("./core/validator.js").Validator<bigint, unknown, import("./core/types.js").ExecutionOptions>;
|
|
8
12
|
declare const isBoolean: import("./core/validator.js").Validator<boolean | undefined, unknown, import("./core/types.js").ExecutionOptions>;
|
|
13
|
+
declare const isBtcAddress: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
14
|
+
declare const isCreditCard: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
9
15
|
declare const isDate: import("./core/validator.js").Validator<Date, string | number | Date, import("./core/types.js").ExecutionOptions>;
|
|
10
16
|
declare const isDateString: import("./core/validator.js").Validator<string, string | number | Date, import("./core/types.js").ExecutionOptions>;
|
|
17
|
+
declare const isDecimal: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
18
|
+
declare const isDefined: import("./core/validator.js").Validator<any, unknown, import("./core/types.js").ExecutionOptions>;
|
|
19
|
+
declare const isEAN: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
20
|
+
declare const isEmail: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
11
21
|
declare const isEmpty: import("./core/validator.js").Validator<any, any, import("./core/types.js").ExecutionOptions>;
|
|
12
|
-
declare const
|
|
22
|
+
declare const isETHAddress: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
23
|
+
declare const isFQDN: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
24
|
+
declare const isHex: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
25
|
+
declare const isHexColor: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
26
|
+
declare const isIBAN: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
13
27
|
declare const isInteger: import("./core/validator.js").Validator<number, unknown, import("./core/types.js").ExecutionOptions>;
|
|
14
|
-
declare const
|
|
28
|
+
declare const isIP: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
29
|
+
declare const isIPRange: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
30
|
+
declare const isISSN: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
31
|
+
declare const isJWT: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
32
|
+
declare const isLowercase: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
33
|
+
declare const isMACAddress: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
34
|
+
declare const isMobilePhone: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
35
|
+
declare const isNotEmpty: import("./core/validator.js").Validator<any, any, import("./core/types.js").ExecutionOptions>;
|
|
15
36
|
declare const isNotNull: import("./core/validator.js").Validator<unknown, unknown, import("./core/types.js").ExecutionOptions>;
|
|
16
|
-
declare const isNullish: import("./core/validator.js").Validator<null, unknown, import("./core/types.js").ExecutionOptions>;
|
|
17
37
|
declare const isNotNullish: import("./core/validator.js").Validator<unknown, unknown, import("./core/types.js").ExecutionOptions>;
|
|
18
|
-
declare const
|
|
19
|
-
declare const
|
|
38
|
+
declare const isNull: import("./core/validator.js").Validator<null, unknown, import("./core/types.js").ExecutionOptions>;
|
|
39
|
+
declare const isNullish: import("./core/validator.js").Validator<null, unknown, import("./core/types.js").ExecutionOptions>;
|
|
20
40
|
declare const isNumber: import("./core/validator.js").Validator<number, unknown, import("./core/types.js").ExecutionOptions>;
|
|
21
41
|
declare const isObject: vg.IsObject.Validator<object, string | object>;
|
|
22
42
|
declare const isObjectId: import("./core/validator.js").Validator<string | vg.ObjectIdLike | Uint8Array<ArrayBufferLike>, unknown, import("./core/types.js").ExecutionOptions>;
|
|
43
|
+
declare const isPort: import("./core/validator.js").Validator<number, string | number, import("./core/types.js").ExecutionOptions>;
|
|
23
44
|
declare const isString: import("./core/validator.js").Validator<string, unknown, import("./core/types.js").ExecutionOptions>;
|
|
45
|
+
declare const isSWIFT: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
46
|
+
declare const isTime: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
47
|
+
declare const isUndefined: import("./core/validator.js").Validator<any, unknown, import("./core/types.js").ExecutionOptions>;
|
|
48
|
+
declare const isUppercase: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
49
|
+
declare const isURL: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
24
50
|
declare const isUUID: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
25
51
|
declare const isUUID1: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
26
52
|
declare const isUUID2: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
27
53
|
declare const isUUID3: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
28
54
|
declare const isUUID4: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
29
55
|
declare const isUUID5: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
30
|
-
declare const isEmail: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
31
|
-
declare const isMobilePhone: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
32
|
-
declare const isIP: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
33
|
-
declare const isIPRange: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
34
|
-
declare const isMACAddress: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
35
|
-
declare const isPort: import("./core/validator.js").Validator<number, string | number, import("./core/types.js").ExecutionOptions>;
|
|
36
|
-
declare const isURL: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
37
|
-
declare const isBase64: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
38
|
-
declare const isSWIFT: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
39
|
-
declare const isCreditCard: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
40
|
-
declare const isIBAN: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
41
|
-
declare const isEAN: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
42
|
-
declare const isFQDN: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
43
|
-
declare const isISSN: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
44
|
-
declare const isBtcAddress: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
45
|
-
declare const isETHAddress: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
46
|
-
declare const isHexColor: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
47
|
-
declare const isJWT: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
48
|
-
declare const isLowercase: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
49
|
-
declare const isUppercase: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
50
|
-
declare const isAlpha: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
51
|
-
declare const isAlphanumeric: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
52
|
-
declare const isAscii: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
53
|
-
declare const isDecimal: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
54
|
-
declare const isHex: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
55
56
|
declare const toArray: import("./core/validator.js").Validator<any[], any, import("./core/types.js").ExecutionOptions>;
|
|
57
|
+
declare const toBigint: import("./core/validator.js").Validator<bigint, unknown, import("./core/types.js").ExecutionOptions>;
|
|
56
58
|
declare const toBoolean: import("./core/validator.js").Validator<boolean | undefined, unknown, import("./core/types.js").ExecutionOptions>;
|
|
57
59
|
declare const toDate: import("./core/validator.js").Validator<Date, string | number | Date, import("./core/types.js").ExecutionOptions>;
|
|
58
|
-
declare const toBigint: import("./core/validator.js").Validator<bigint, unknown, import("./core/types.js").ExecutionOptions>;
|
|
59
60
|
declare const toDateString: import("./core/validator.js").Validator<string, string | number | Date, import("./core/types.js").ExecutionOptions>;
|
|
60
61
|
declare const toInteger: import("./core/validator.js").Validator<number, unknown, import("./core/types.js").ExecutionOptions>;
|
|
61
62
|
declare const toNumber: import("./core/validator.js").Validator<number, unknown, import("./core/types.js").ExecutionOptions>;
|
|
62
63
|
declare const toString: import("./core/validator.js").Validator<string, unknown, import("./core/types.js").ExecutionOptions>;
|
|
63
|
-
|
|
64
|
+
declare const toTime: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
65
|
+
export { isAlpha, isAlphanumeric, isAny, isArray, isAscii, isBase64, isBigint, isBoolean, isBtcAddress, isCreditCard, isDate, isDateString, isDecimal, isDefined, isEAN, isEmail, isEmpty, isETHAddress, isFQDN, isHex, isHexColor, isIBAN, isInteger, isIP, isIPRange, isISSN, isJWT, isLowercase, isMACAddress, isMobilePhone, isNotEmpty, isNotNull, isNotNullish, isNull, isNullish, isNumber, isObject, isObjectId, isPort, isString, isSWIFT, isTime, isUndefined, isUppercase, isURL, isUUID, isUUID1, isUUID2, isUUID3, isUUID4, isUUID5, toArray, toBigint, toBoolean, toDate, toDateString, toInteger, toNumber, toString, toTime, vg, };
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import type { Nullish } from 'ts-gems';
|
|
2
2
|
import { type ValidationOptions, type Validator } from '../../core/index.js';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Check if value is not nullish before calling nested rule
|
|
5
5
|
* @validator required
|
|
6
6
|
*/
|
|
7
|
-
export declare function required<T, I>(nested: Validator<T, I>, options?:
|
|
7
|
+
export declare function required<T, I>(nested: Validator<T, I>, options?: RequiredValidatorOptions): Validator<Nullish<T>, I, import("../../core/types.js").ExecutionOptions>;
|
|
8
|
+
export interface RequiredValidatorOptions extends ValidationOptions {
|
|
9
|
+
default?: any;
|
|
10
|
+
}
|