File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,11 +22,7 @@ export default function (argv: ParsedArgs): AjvCore {
2222 if ( invalid ) process . exit ( 1 )
2323 return ajv
2424
25- function addSchemas (
26- args : string | string [ ] | undefined ,
27- method : AjvMethod ,
28- fileType : string
29- ) : void {
25+ function addSchemas ( args : string | string [ ] | undefined , method : AjvMethod , fileType : string ) : void {
3026 if ( ! args ) return
3127 const files = util . getFiles ( args )
3228 files . forEach ( ( file ) => {
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ function execute(argv: ParsedArgs): boolean {
5050 const sch = openFile ( file , `schema ${ file } ` )
5151 try {
5252 const id = sch ?. $id
53- ajv . addSchema ( sch , id ? undefined : file )
53+ ajv . addSchema ( sch , id ? undefined : file )
5454 const validate = ajv . getSchema ( id || file )
5555 if ( argv . o !== true ) console . log ( `schema ${ file } is valid` )
5656 return validate
@@ -61,7 +61,7 @@ function execute(argv: ParsedArgs): boolean {
6161 }
6262 }
6363
64- function getRefs ( validators : AnyValidateFunction [ ] , files : string [ ] ) : { [ K in string ] ?: string } {
64+ function getRefs ( validators : AnyValidateFunction [ ] , files : string [ ] ) : { [ K in string ] ?: string } {
6565 const refs : { [ K in string ] ?: string } = { }
6666 validators . forEach ( ( v , i ) => {
6767 const ref = typeof v . schema == "object" ? v . schema . $id || files [ i ] : files [ i ]
Original file line number Diff line number Diff line change @@ -33,9 +33,7 @@ function execute(argv: ParsedArgs): boolean {
3333 const ajv = getAjv ( argv )
3434 const validate = compile ( ajv , argv . s )
3535 const shouldBeValid = ! ! argv . valid && argv . valid !== "false"
36- return getFiles ( argv . d )
37- . map ( testDataFile )
38- . every ( ( x ) => x )
36+ return getFiles ( argv . d ) . map ( testDataFile ) . every ( ( x ) => x )
3937
4038 function testDataFile ( file : string ) : boolean {
4139 const data = openFile ( file , `data file ${ file } ` )
You can’t perform that action at this time.
0 commit comments