File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change 11/// <reference path="../../../index.d.ts" /> // here we make a reference to exists module definition
2- import ValidatorType , { ValidationSchema } from 'fastest-validator' ; // here we importing type definition of default export
2+ import ValidatorType from 'fastest-validator' ; // here we importing type definition of default export
33
44const Validator : typeof ValidatorType = require ( '../../../index' ) ; // here we importing real Validator Constructor
55const v : ValidatorType = new Validator ( ) ;
@@ -44,7 +44,7 @@ describe('TypeScript Definitions', () => {
4444 it ( 'should sanitize' , ( ) => {
4545 const check = v . compile ( { status : { type : 'boolean' , convert : true } } ) ;
4646
47- let obj : ValidationSchema = { status : 0 } ;
47+ let obj : { status : number | boolean | 'true' | 'false' | 'on' | 'off' } = { status : 0 } ;
4848 expect ( check ( obj ) ) . toEqual ( true ) ;
4949 expect ( obj ) . toEqual ( { status : false } ) ;
5050
You can’t perform that action at this time.
0 commit comments