Skip to content

Commit 75d9122

Browse files
committed
add ts test code (wip)
1 parent 5676d99 commit 75d9122

File tree

7 files changed

+895
-10
lines changed

7 files changed

+895
-10
lines changed

.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,9 @@ node_js:
77
- "12"
88
- "10"
99
- "8"
10+
11+
script:
12+
- npm run test:travis
13+
1014
after_success:
1115
- npm run coverall

index.d.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ declare module 'fastest-validator' {
413413
* @param {ValidationRuleObject} schema Validation schema that describes current custom validator
414414
* @return {{true} | ValidationError[]} true if result is valid or array of validation error messages
415415
*/
416-
check: (value: T, schema: ValidationRuleObject, path: string, parent?: object, context: any) => true | ValidationError[];
416+
check: (value: T, schema: ValidationRuleObject, path: string, parent?: object, context?: any) => true | ValidationError[];
417417
}
418418

419419
/**
@@ -685,10 +685,6 @@ declare module 'fastest-validator' {
685685
* Definition for validation schema based on validation rules
686686
*/
687687
interface ValidationSchema {
688-
/**
689-
* List of validation rules for each defined field
690-
*/
691-
[key: string]: ValidationRule | boolean;
692688
/**
693689
* Object properties which are not specified on the schema are ignored by default.
694690
* If you set the $$strict option to true any aditional properties will result in an strictObject error.
@@ -697,6 +693,11 @@ declare module 'fastest-validator' {
697693
$$strict?: boolean;
698694

699695
$$root?: boolean;
696+
697+
/**
698+
* List of validation rules for each defined field
699+
*/
700+
[key: string]: ValidationRule | boolean | undefined;
700701
}
701702

702703
/**

0 commit comments

Comments
 (0)