valgen 5.4.1 → 5.6.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/CHANGELOG.md +18 -0
- package/cjs/core/context.js +13 -10
- package/cjs/core/index.js +2 -2
- package/cjs/core/utilities.js +4 -5
- package/cjs/core/validator.js +10 -7
- package/cjs/helpers/object.utils.js +2 -3
- package/cjs/helpers/omit-undefined.js +1 -2
- package/cjs/helpers/string.utils.js +2 -5
- package/cjs/index.js +6 -2
- package/cjs/rules/format-rules/is-alpha.js +6 -6
- package/cjs/rules/format-rules/is-ascii.js +2 -3
- package/cjs/rules/format-rules/is-base64.js +4 -4
- package/cjs/rules/format-rules/is-btc-address.js +4 -4
- package/cjs/rules/format-rules/is-credit-card.js +5 -4
- package/cjs/rules/format-rules/is-decimal.js +4 -4
- package/cjs/rules/format-rules/is-ean.js +2 -3
- package/cjs/rules/format-rules/is-email.js +4 -4
- package/cjs/rules/format-rules/is-eth-address.js +4 -4
- package/cjs/rules/format-rules/is-fqdn.js +4 -4
- package/cjs/rules/format-rules/is-hash.js +4 -4
- package/cjs/rules/format-rules/is-hex-color.js +4 -4
- package/cjs/rules/format-rules/is-hex.js +4 -4
- package/cjs/rules/format-rules/is-iban.js +4 -5
- package/cjs/rules/format-rules/is-ip.js +12 -7
- package/cjs/rules/format-rules/is-issn.js +4 -4
- package/cjs/rules/format-rules/is-jwt.js +2 -3
- package/cjs/rules/format-rules/is-lowercase.js +8 -7
- package/cjs/rules/format-rules/is-mac-address.js +6 -4
- package/cjs/rules/format-rules/is-mobile-phone.js +5 -4
- package/cjs/rules/format-rules/is-object-id.js +7 -5
- package/cjs/rules/format-rules/is-passport-number.js +5 -4
- package/cjs/rules/format-rules/is-port.js +6 -4
- package/cjs/rules/format-rules/is-url.js +6 -4
- package/cjs/rules/format-rules/is-uuid.js +6 -4
- package/cjs/rules/format-rules/is-vat-number.js +4 -4
- package/cjs/rules/format-rules/matches.js +2 -3
- package/cjs/rules/index.js +14 -13
- package/cjs/rules/logical-rules/is-defined.js +2 -17
- package/cjs/rules/logical-rules/is-empty.js +4 -5
- package/cjs/rules/logical-rules/range.js +57 -26
- package/cjs/rules/type-rules/is-any.js +1 -3
- package/cjs/rules/type-rules/is-array.js +5 -4
- package/cjs/rules/type-rules/is-bigint.js +5 -4
- package/cjs/rules/type-rules/is-boolean.js +2 -3
- package/cjs/rules/type-rules/is-date.js +13 -8
- package/cjs/rules/type-rules/is-enum.js +7 -4
- package/cjs/rules/type-rules/is-integer.js +11 -5
- package/cjs/rules/type-rules/is-null.js +34 -14
- package/cjs/rules/type-rules/is-number.js +7 -4
- package/cjs/rules/type-rules/is-object.js +20 -12
- package/cjs/rules/type-rules/is-record.js +2 -3
- package/cjs/rules/type-rules/is-string.js +11 -11
- package/cjs/rules/type-rules/is-tuple.js +7 -5
- package/cjs/rules/type-rules/is-undefined.js +17 -0
- package/cjs/rules/utility-rules/exists.js +6 -4
- package/cjs/rules/utility-rules/get-length.js +10 -5
- package/cjs/rules/utility-rules/optional.js +2 -3
- package/cjs/rules/utility-rules/pipe.js +5 -6
- package/cjs/rules/utility-rules/required.js +2 -3
- package/cjs/rules/utility-rules/union.js +2 -3
- package/esm/core/context.js +13 -10
- package/esm/core/index.js +2 -2
- package/esm/core/utilities.js +3 -3
- package/esm/core/validator.js +8 -4
- package/esm/helpers/string.utils.js +1 -3
- package/esm/index.js +3 -1
- package/esm/rules/format-rules/is-alpha.js +4 -3
- package/esm/rules/format-rules/is-ascii.js +1 -1
- package/esm/rules/format-rules/is-base64.js +3 -2
- package/esm/rules/format-rules/is-btc-address.js +3 -2
- package/esm/rules/format-rules/is-credit-card.js +4 -2
- package/esm/rules/format-rules/is-decimal.js +3 -2
- package/esm/rules/format-rules/is-ean.js +1 -1
- package/esm/rules/format-rules/is-email.js +3 -2
- package/esm/rules/format-rules/is-eth-address.js +3 -2
- package/esm/rules/format-rules/is-fqdn.js +3 -2
- package/esm/rules/format-rules/is-hash.js +3 -2
- package/esm/rules/format-rules/is-hex-color.js +3 -2
- package/esm/rules/format-rules/is-hex.js +3 -2
- package/esm/rules/format-rules/is-iban.js +2 -2
- package/esm/rules/format-rules/is-ip.js +10 -4
- package/esm/rules/format-rules/is-issn.js +3 -2
- package/esm/rules/format-rules/is-jwt.js +1 -1
- package/esm/rules/format-rules/is-lowercase.js +6 -4
- package/esm/rules/format-rules/is-mac-address.js +5 -2
- package/esm/rules/format-rules/is-mobile-phone.js +4 -2
- package/esm/rules/format-rules/is-object-id.js +7 -4
- package/esm/rules/format-rules/is-passport-number.js +4 -2
- package/esm/rules/format-rules/is-port.js +5 -2
- package/esm/rules/format-rules/is-url.js +5 -2
- package/esm/rules/format-rules/is-uuid.js +5 -2
- package/esm/rules/format-rules/is-vat-number.js +3 -2
- package/esm/rules/format-rules/matches.js +2 -2
- package/esm/rules/index.js +14 -13
- package/esm/rules/logical-rules/is-defined.js +1 -14
- package/esm/rules/logical-rules/is-empty.js +2 -2
- package/esm/rules/logical-rules/range.js +52 -21
- package/esm/rules/type-rules/is-any.js +1 -3
- package/esm/rules/type-rules/is-array.js +5 -3
- package/esm/rules/type-rules/is-bigint.js +4 -2
- package/esm/rules/type-rules/is-boolean.js +2 -2
- package/esm/rules/type-rules/is-date.js +11 -5
- package/esm/rules/type-rules/is-enum.js +7 -3
- package/esm/rules/type-rules/is-integer.js +11 -4
- package/esm/rules/type-rules/is-null.js +30 -11
- package/esm/rules/type-rules/is-number.js +6 -2
- package/esm/rules/type-rules/is-object.js +19 -10
- package/esm/rules/type-rules/is-record.js +2 -2
- package/esm/rules/type-rules/is-string.js +7 -7
- package/esm/rules/type-rules/is-tuple.js +7 -4
- package/esm/rules/type-rules/is-undefined.js +14 -0
- package/esm/rules/utility-rules/exists.js +5 -2
- package/esm/rules/utility-rules/get-length.js +9 -3
- package/esm/rules/utility-rules/optional.js +2 -2
- package/esm/rules/utility-rules/pipe.js +4 -4
- package/esm/rules/utility-rules/required.js +2 -2
- package/esm/rules/utility-rules/union.js +1 -1
- package/package.json +2 -2
- package/typings/core/index.d.ts +3 -3
- package/typings/core/types.d.ts +1 -1
- package/typings/index.d.ts +3 -1
- package/typings/rules/index.d.ts +14 -13
- package/typings/rules/logical-rules/is-defined.d.ts +0 -5
- package/typings/rules/type-rules/is-null.d.ts +11 -1
- package/typings/rules/type-rules/is-tuple.d.ts +36 -4
- package/typings/rules/type-rules/is-undefined.d.ts +6 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { validator, } from '../../core/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* Validates if value is "undefined"
|
|
4
|
+
* @validator isUndefined
|
|
5
|
+
*/
|
|
6
|
+
export function isUndefined(options) {
|
|
7
|
+
return validator('isUndefined', (input, context, _this) => {
|
|
8
|
+
if (options?.coerce || context.coerce)
|
|
9
|
+
return undefined;
|
|
10
|
+
if (input === undefined)
|
|
11
|
+
return;
|
|
12
|
+
context.fail(_this, `{{label}} mustn't be defined`, input);
|
|
13
|
+
}, options);
|
|
14
|
+
}
|
|
@@ -4,9 +4,12 @@ import { validator } from '../../core/index.js';
|
|
|
4
4
|
* @validator exists
|
|
5
5
|
*/
|
|
6
6
|
export function exists(options) {
|
|
7
|
-
return validator('exists',
|
|
8
|
-
if (input !== undefined ||
|
|
7
|
+
return validator('exists', (input, context, _this) => {
|
|
8
|
+
if (input !== undefined ||
|
|
9
|
+
(context.scope &&
|
|
10
|
+
Object.getOwnPropertyDescriptor(context.scope, input))) {
|
|
9
11
|
return input;
|
|
12
|
+
}
|
|
10
13
|
context.fail(_this, `{{label}} must exist`, input);
|
|
11
14
|
}, options);
|
|
12
15
|
}
|
|
@@ -4,17 +4,23 @@ import { validator } from '../../core/index.js';
|
|
|
4
4
|
* @validator getLength
|
|
5
5
|
*/
|
|
6
6
|
export function getLength() {
|
|
7
|
-
return validator('getLength',
|
|
7
|
+
return validator('getLength', (input, context, _this) => {
|
|
8
8
|
if (typeof input === 'string')
|
|
9
9
|
return input.length;
|
|
10
10
|
if (Array.isArray(input))
|
|
11
11
|
return input.length;
|
|
12
12
|
if (input instanceof ArrayBuffer)
|
|
13
13
|
return input.byteLength;
|
|
14
|
-
if (input &&
|
|
14
|
+
if (input &&
|
|
15
|
+
typeof input === 'object' &&
|
|
16
|
+
typeof input.length === 'number') {
|
|
15
17
|
return input.length;
|
|
16
|
-
|
|
18
|
+
}
|
|
19
|
+
if (input &&
|
|
20
|
+
typeof input === 'object' &&
|
|
21
|
+
typeof input.size === 'number') {
|
|
17
22
|
return input.size;
|
|
23
|
+
}
|
|
18
24
|
context.fail(_this, `Unable to get length of {{label}}`, input);
|
|
19
25
|
});
|
|
20
26
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { validator } from '../../core/index.js';
|
|
1
|
+
import { validator, } from '../../core/index.js';
|
|
2
2
|
/**
|
|
3
3
|
* Makes sub-rule optional
|
|
4
4
|
* @validator optional
|
|
5
5
|
*/
|
|
6
6
|
export function optional(nested, options) {
|
|
7
|
-
return validator('optional',
|
|
7
|
+
return validator('optional', (input, context) => {
|
|
8
8
|
if (input == null)
|
|
9
9
|
return input;
|
|
10
10
|
return nested(input, context);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { validator } from '../../core/index.js';
|
|
1
|
+
import { validator, } from '../../core/index.js';
|
|
2
2
|
/**
|
|
3
3
|
*
|
|
4
4
|
* @validator pipe
|
|
@@ -6,11 +6,11 @@ import { validator } from '../../core/index.js';
|
|
|
6
6
|
export function pipe(rules, options) {
|
|
7
7
|
const l = rules.length;
|
|
8
8
|
const returnIndex = options?.returnIndex;
|
|
9
|
-
return validator('pipe',
|
|
9
|
+
return validator('pipe', (input, context) => {
|
|
10
10
|
let i;
|
|
11
11
|
let c;
|
|
12
12
|
let v = input;
|
|
13
|
-
let returnValue;
|
|
13
|
+
let returnValue = input;
|
|
14
14
|
for (i = 0; i < l; i++) {
|
|
15
15
|
c = rules[i];
|
|
16
16
|
v = c(v, context);
|
|
@@ -27,7 +27,7 @@ export function pipe(rules, options) {
|
|
|
27
27
|
* @validator allOf
|
|
28
28
|
*/
|
|
29
29
|
export function allOf(rules) {
|
|
30
|
-
return validator('allOf',
|
|
30
|
+
return validator('allOf', (input, context) => {
|
|
31
31
|
let i;
|
|
32
32
|
let c;
|
|
33
33
|
const l = rules.length;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { validator } from '../../core/index.js';
|
|
1
|
+
import { validator, } from '../../core/index.js';
|
|
2
2
|
/**
|
|
3
3
|
* Makes sub-rule required
|
|
4
4
|
* @validator required
|
|
5
5
|
*/
|
|
6
6
|
export function required(nested, options) {
|
|
7
|
-
return validator('required',
|
|
7
|
+
return validator('required', (input, context, _this) => {
|
|
8
8
|
if (input == null) {
|
|
9
9
|
context.fail(_this, `{{label}} is required`, input);
|
|
10
10
|
return;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "valgen",
|
|
3
3
|
"description": "Fast runtime type validator, converter and io (encoding/decoding) library",
|
|
4
|
-
"version": "5.
|
|
4
|
+
"version": "5.6.0",
|
|
5
5
|
"author": "Panates",
|
|
6
6
|
"contributors": [
|
|
7
7
|
"Eray Hanoglu <e.hanoglu@panates.com>"
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"url": "https://github.com/panates/valgen.git"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@types/validator": "^13.
|
|
15
|
+
"@types/validator": "^13.12.0",
|
|
16
16
|
"date-fns": "^3.6.0",
|
|
17
17
|
"ts-gems": "^3.4.0",
|
|
18
18
|
"validator": "^13.12.0"
|
package/typings/core/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export * from './context.js';
|
|
2
1
|
export * from './constants.js';
|
|
2
|
+
export * from './context.js';
|
|
3
3
|
export * from './types.js';
|
|
4
|
+
export * from './utilities.js';
|
|
4
5
|
export * from './validation-error.js';
|
|
5
6
|
export * from './validator.js';
|
|
6
|
-
export
|
|
7
|
-
export { Nullish, Type, Maybe } from 'ts-gems';
|
|
7
|
+
export { Maybe, Nullish, Type } from 'ts-gems';
|
package/typings/core/types.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export interface ErrorIssue {
|
|
|
11
11
|
label?: string;
|
|
12
12
|
[key: string]: any;
|
|
13
13
|
}
|
|
14
|
-
export type OnFailFunction = (issue: ErrorIssue, context: Context
|
|
14
|
+
export type OnFailFunction = (issue: ErrorIssue, context: Context) => string | Omit<ErrorIssue, 'id' | 'input'>;
|
|
15
15
|
export interface ValidationOptions {
|
|
16
16
|
onFail?: OnFailFunction;
|
|
17
17
|
coerce?: boolean;
|
package/typings/index.d.ts
CHANGED
|
@@ -12,7 +12,9 @@ declare const isEmpty: import("./core/validator.js").Validator<string | object |
|
|
|
12
12
|
declare const isNotEmpty: import("./core/validator.js").Validator<string | object | any[] | Set<any> | Map<any, any>, string | object | any[] | Set<any> | Map<any, any>, import("./core/types.js").ExecutionOptions>;
|
|
13
13
|
declare const isInteger: import("./core/validator.js").Validator<number, unknown, import("./core/types.js").ExecutionOptions>;
|
|
14
14
|
declare const isNull: import("./core/validator.js").Validator<null, unknown, import("./core/types.js").ExecutionOptions>;
|
|
15
|
+
declare const isNotNull: import("./core/validator.js").Validator<unknown, unknown, import("./core/types.js").ExecutionOptions>;
|
|
15
16
|
declare const isNullish: import("./core/validator.js").Validator<null, unknown, import("./core/types.js").ExecutionOptions>;
|
|
17
|
+
declare const isNotNullish: import("./core/validator.js").Validator<unknown, unknown, import("./core/types.js").ExecutionOptions>;
|
|
16
18
|
declare const isDefined: import("./core/validator.js").Validator<any, unknown, import("./core/types.js").ExecutionOptions>;
|
|
17
19
|
declare const isUndefined: import("./core/validator.js").Validator<any, unknown, import("./core/types.js").ExecutionOptions>;
|
|
18
20
|
declare const isNumber: import("./core/validator.js").Validator<number, unknown, import("./core/types.js").ExecutionOptions>;
|
|
@@ -58,4 +60,4 @@ declare const toDateString: import("./core/validator.js").Validator<string, stri
|
|
|
58
60
|
declare const toInteger: import("./core/validator.js").Validator<number, unknown, import("./core/types.js").ExecutionOptions>;
|
|
59
61
|
declare const toNumber: import("./core/validator.js").Validator<number, unknown, import("./core/types.js").ExecutionOptions>;
|
|
60
62
|
declare const toString: import("./core/validator.js").Validator<string, unknown, import("./core/types.js").ExecutionOptions>;
|
|
61
|
-
export {
|
|
63
|
+
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, isUndefined, isUppercase, isURL, isUUID, isUUID1, isUUID2, isUUID3, isUUID4, isUUID5, toArray, toBigint, toBoolean, toDate, toDateString, toInteger, toNumber, toString, vg, };
|
package/typings/rules/index.d.ts
CHANGED
|
@@ -1,16 +1,3 @@
|
|
|
1
|
-
export * from './type-rules/is-any.js';
|
|
2
|
-
export * from './type-rules/is-array.js';
|
|
3
|
-
export * from './type-rules/is-bigint.js';
|
|
4
|
-
export * from './type-rules/is-boolean.js';
|
|
5
|
-
export * from './type-rules/is-date.js';
|
|
6
|
-
export * from './type-rules/is-enum.js';
|
|
7
|
-
export * from './type-rules/is-integer.js';
|
|
8
|
-
export * from './type-rules/is-null.js';
|
|
9
|
-
export * from './type-rules/is-number.js';
|
|
10
|
-
export * from './type-rules/is-object.js';
|
|
11
|
-
export * from './type-rules/is-record.js';
|
|
12
|
-
export * from './type-rules/is-string.js';
|
|
13
|
-
export * from './type-rules/is-tuple.js';
|
|
14
1
|
export * from './format-rules/is-alpha.js';
|
|
15
2
|
export * from './format-rules/is-ascii.js';
|
|
16
3
|
export * from './format-rules/is-base64.js';
|
|
@@ -41,6 +28,20 @@ export * from './format-rules/matches.js';
|
|
|
41
28
|
export * from './logical-rules/is-defined.js';
|
|
42
29
|
export * from './logical-rules/is-empty.js';
|
|
43
30
|
export * from './logical-rules/range.js';
|
|
31
|
+
export * from './type-rules/is-any.js';
|
|
32
|
+
export * from './type-rules/is-array.js';
|
|
33
|
+
export * from './type-rules/is-bigint.js';
|
|
34
|
+
export * from './type-rules/is-boolean.js';
|
|
35
|
+
export * from './type-rules/is-date.js';
|
|
36
|
+
export * from './type-rules/is-enum.js';
|
|
37
|
+
export * from './type-rules/is-integer.js';
|
|
38
|
+
export * from './type-rules/is-null.js';
|
|
39
|
+
export * from './type-rules/is-number.js';
|
|
40
|
+
export * from './type-rules/is-object.js';
|
|
41
|
+
export * from './type-rules/is-record.js';
|
|
42
|
+
export * from './type-rules/is-string.js';
|
|
43
|
+
export * from './type-rules/is-tuple.js';
|
|
44
|
+
export * from './type-rules/is-undefined.js';
|
|
44
45
|
export * from './utility-rules/exists.js';
|
|
45
46
|
export * from './utility-rules/get-length.js';
|
|
46
47
|
export * from './utility-rules/optional.js';
|
|
@@ -4,8 +4,3 @@ import { ValidationOptions } from '../../core/index.js';
|
|
|
4
4
|
* @validator isDefined
|
|
5
5
|
*/
|
|
6
6
|
export declare function isDefined(options?: ValidationOptions): import("../../core/validator.js").Validator<any, unknown, import("../../core/types.js").ExecutionOptions>;
|
|
7
|
-
/**
|
|
8
|
-
* Validates if value is "undefined"
|
|
9
|
-
* @validator isUndefined
|
|
10
|
-
*/
|
|
11
|
-
export declare function isUndefined(options?: ValidationOptions): import("../../core/validator.js").Validator<any, unknown, import("../../core/types.js").ExecutionOptions>;
|
|
@@ -4,8 +4,18 @@ import { ValidationOptions } from '../../core/index.js';
|
|
|
4
4
|
* @validator isNull
|
|
5
5
|
*/
|
|
6
6
|
export declare function isNull(options?: ValidationOptions): import("../../core/validator.js").Validator<null, unknown, import("../../core/types.js").ExecutionOptions>;
|
|
7
|
+
/**
|
|
8
|
+
* Validates if value is not "null".
|
|
9
|
+
* @validator isNotNull
|
|
10
|
+
*/
|
|
11
|
+
export declare function isNotNull(options?: ValidationOptions): import("../../core/validator.js").Validator<unknown, unknown, import("../../core/types.js").ExecutionOptions>;
|
|
7
12
|
/**
|
|
8
13
|
* Validates if value is "null" or "undefined".
|
|
9
|
-
* @validator
|
|
14
|
+
* @validator isNullish
|
|
10
15
|
*/
|
|
11
16
|
export declare function isNullish(options?: ValidationOptions): import("../../core/validator.js").Validator<null, unknown, import("../../core/types.js").ExecutionOptions>;
|
|
17
|
+
/**
|
|
18
|
+
* Validates if value is not "null" nor "undefined".
|
|
19
|
+
* @validator isNotNullish
|
|
20
|
+
*/
|
|
21
|
+
export declare function isNotNullish(options?: ValidationOptions): import("../../core/validator.js").Validator<unknown, unknown, import("../../core/types.js").ExecutionOptions>;
|
|
@@ -7,9 +7,25 @@ import { ValidationOptions, Validator } from '../../core/index.js';
|
|
|
7
7
|
export declare function isTuple<T1, I1>(items: [Validator<T1, I1>], options?: ValidationOptions): Validator<[T1], [I1]>;
|
|
8
8
|
export declare function isTuple<T1, I1, T2, I2>(items: [Validator<T1, I1>, Validator<T2, I2>], options?: ValidationOptions): Validator<[T1, T2], [I1, I2]>;
|
|
9
9
|
export declare function isTuple<T1, I1, T2, I2, T3, I3>(items: [Validator<T1, I1>, Validator<T2, I2>, Validator<T3, I3>], options?: ValidationOptions): Validator<[T1, T2, T3], [I1, I2, I3]>;
|
|
10
|
-
export declare function isTuple<T1, I1, T2, I2, T3, I3, T4, I4>(items: [
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
export declare function isTuple<T1, I1, T2, I2, T3, I3, T4, I4>(items: [
|
|
11
|
+
Validator<T1, I1>,
|
|
12
|
+
Validator<T2, I2>,
|
|
13
|
+
Validator<T3, I3>,
|
|
14
|
+
Validator<T4, I4>
|
|
15
|
+
], options?: ValidationOptions): Validator<[T1, T2, T3, T4], [I1, I2, I3, I4]>;
|
|
16
|
+
export declare function isTuple<T1, I1, T2, I2, T3, I3, T4, I4>(items: [
|
|
17
|
+
Validator<T1, I1>,
|
|
18
|
+
Validator<T2, I2>,
|
|
19
|
+
Validator<T3, I3>,
|
|
20
|
+
Validator<T4, I4>
|
|
21
|
+
], options?: ValidationOptions): Validator<[T1, T2, T3, T4], [I1, I2, I3, I4]>;
|
|
22
|
+
export declare function isTuple<T1, I1, T2, I2, T3, I3, T4, I4, T5, I5>(items: [
|
|
23
|
+
Validator<T1, I1>,
|
|
24
|
+
Validator<T2, I2>,
|
|
25
|
+
Validator<T3, I3>,
|
|
26
|
+
Validator<T4, I4>,
|
|
27
|
+
Validator<T5, I5>
|
|
28
|
+
], options?: ValidationOptions): Validator<[T1, T2, T3, T4, T5], [I1, I2, I3, I4, I5]>;
|
|
13
29
|
export declare function isTuple<T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6>(items: [
|
|
14
30
|
Validator<T1, I1>,
|
|
15
31
|
Validator<T2, I2>,
|
|
@@ -18,4 +34,20 @@ export declare function isTuple<T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6>(
|
|
|
18
34
|
Validator<T5, I5>,
|
|
19
35
|
Validator<T6, I6>,
|
|
20
36
|
...Validator[]
|
|
21
|
-
], options?: ValidationOptions): Validator<[
|
|
37
|
+
], options?: ValidationOptions): Validator<[
|
|
38
|
+
T1,
|
|
39
|
+
T2,
|
|
40
|
+
T3,
|
|
41
|
+
T4,
|
|
42
|
+
T5,
|
|
43
|
+
T6,
|
|
44
|
+
...any[]
|
|
45
|
+
], [
|
|
46
|
+
I1,
|
|
47
|
+
I2,
|
|
48
|
+
I3,
|
|
49
|
+
I4,
|
|
50
|
+
I5,
|
|
51
|
+
I5,
|
|
52
|
+
...any[]
|
|
53
|
+
]>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ValidationOptions } from '../../core/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* Validates if value is "undefined"
|
|
4
|
+
* @validator isUndefined
|
|
5
|
+
*/
|
|
6
|
+
export declare function isUndefined(options?: ValidationOptions): import("../../core/validator.js").Validator<any, unknown, import("../../core/types.js").ExecutionOptions>;
|