Skip to content

Commit 54b94aa

Browse files
authored
fix(types): unique is missing in array definition
1 parent 105f908 commit 54b94aa

File tree

1 file changed

+37
-33
lines changed

1 file changed

+37
-33
lines changed

index.d.ts

Lines changed: 37 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -39,39 +39,43 @@ export interface RuleAny extends RuleCustom {
3939
* @see https://github.com/icebob/fastest-validator#array
4040
*/
4141
export interface RuleArray<T = any> extends RuleCustom {
42-
/**
43-
* Name of built-in validator
44-
*/
45-
type: "array";
46-
/**
47-
* If true, the validator accepts an empty array [].
48-
* @default true
49-
*/
50-
empty?: boolean;
51-
/**
52-
* Minimum count of elements
53-
*/
54-
min?: number;
55-
/**
56-
* Maximum count of elements
57-
*/
58-
max?: number;
59-
/**
60-
* Fixed count of elements
61-
*/
62-
length?: number;
63-
/**
64-
* The array must contain this element too
65-
*/
66-
contains?: T | T[];
67-
/**
68-
* Every element must be an element of the enum array
69-
*/
70-
enum?: T[];
71-
/**
72-
* Validation rules that should be applied to each element of array
73-
*/
74-
items?: ValidationRule;
42+
/**
43+
* Name of built-in validator
44+
*/
45+
type: "array";
46+
/**
47+
* If true, the validator accepts an empty array [].
48+
* @default true
49+
*/
50+
empty?: boolean;
51+
/**
52+
* Minimum count of elements
53+
*/
54+
min?: number;
55+
/**
56+
* Maximum count of elements
57+
*/
58+
max?: number;
59+
/**
60+
* Fixed count of elements
61+
*/
62+
length?: number;
63+
/**
64+
* The array must contain this element too
65+
*/
66+
contains?: T | T[];
67+
/**
68+
* Every element must be an element of the enum array
69+
*/
70+
enum?: T[];
71+
/**
72+
* Validation rules that should be applied to each element of array
73+
*/
74+
items?: ValidationRule;
75+
/**
76+
* The array must be unique (array of objects is always unique).
77+
*/
78+
unique?: boolean;
7579
}
7680

7781
/**

0 commit comments

Comments
 (0)