@@ -50,13 +50,13 @@ import {
5050} from './schema-nodes.ts' ;
5151import type {
5252 JSONSchema ,
53+ JSONSchemaAllOf ,
5354 JSONSchemaArray ,
5455 JSONSchemaBoolean ,
5556 JSONSchemaNull ,
5657 JSONSchemaNumber ,
5758 JSONSchemaObject ,
5859 JSONSchemaString ,
59- JSONSchemaAllOf ,
6060} from './types.ts' ;
6161import { appendSchema , capitalize , normalizeTitle } from './utils/basic.ts' ;
6262import { findAndHandleCircularReferences } from './utils/circular-refs.ts' ;
@@ -400,23 +400,21 @@ class ValibotGenerator {
400400 ] ;
401401 return schemaNodeAllOf ( {
402402 value : schema . allOf . map ( ( item ) =>
403- this . parseSchema ( item , true , { parentRequired : combinedRequired } ) ,
403+ this . parseSchema ( item , true , { parentRequired : combinedRequired } )
404404 ) ,
405405 } ) ;
406406 } else if ( 'oneOf' in schema ) {
407407 return schemaNodeOneOf ( {
408- value : schema . oneOf . map ( ( item ) =>
409- this . parseSchema ( item , true , meta ) ,
410- ) ,
408+ value : schema . oneOf . map ( ( item ) => this . parseSchema ( item , true , meta ) ) ,
411409 } ) ;
412410 } else if ( 'anyOf' in schema ) {
413411 return schemaNodeAnyOf ( {
414- value : schema . anyOf . map ( ( item ) =>
415- this . parseSchema ( item , true , meta ) ,
416- ) ,
412+ value : schema . anyOf . map ( ( item ) => this . parseSchema ( item , true , meta ) ) ,
417413 } ) ;
418414 } else if ( 'not' in schema ) {
419- return schemaNodeNot ( { value : this . parseSchema ( schema . not , true , meta ) } ) ;
415+ return schemaNodeNot ( {
416+ value : this . parseSchema ( schema . not , true , meta ) ,
417+ } ) ;
420418 }
421419 console . error ( schema ) ;
422420 throw new Error (
@@ -448,7 +446,7 @@ class ValibotGenerator {
448446 private parseStringType (
449447 schema : JSONSchemaString ,
450448 required : boolean ,
451- meta ?: { parentRequired ?: string [ ] }
449+ _meta ?: { parentRequired ?: string [ ] }
452450 ) : AnyNode {
453451 let value : AnyNode = schemaNodeString ( ) ;
454452
@@ -524,7 +522,7 @@ class ValibotGenerator {
524522 private parseNumberType (
525523 schema : JSONSchemaNumber ,
526524 required : boolean ,
527- meta ?: { parentRequired ?: string [ ] }
525+ _meta ?: { parentRequired ?: string [ ] }
528526 ) : AnyNode {
529527 let value : AnyNode = schemaNodeNumber ( ) ;
530528
@@ -563,9 +561,7 @@ class ValibotGenerator {
563561 }
564562 const kind = Array . isArray ( schema . items )
565563 ? schemaNodeUnion ( {
566- value : schema . items . map ( ( item ) =>
567- this . parseSchema ( item , true , meta ) ,
568- ) ,
564+ value : schema . items . map ( ( item ) => this . parseSchema ( item , true , meta ) ) ,
569565 } )
570566 : this . parseSchema ( schema . items , true , meta ) ;
571567 let value : AnyNode = schemaNodeArray ( { value : kind } ) ;
@@ -594,7 +590,7 @@ class ValibotGenerator {
594590 private parseBooleanType (
595591 schema : JSONSchemaBoolean ,
596592 required : boolean ,
597- meta ?: { parentRequired ?: string [ ] }
593+ _meta ?: { parentRequired ?: string [ ] }
598594 ) : AnyNode {
599595 let value : AnyNode = schemaNodeBoolean ( ) ;
600596 const actions : ActionNode [ ] = [ ] ;
@@ -611,7 +607,7 @@ class ValibotGenerator {
611607 private parseNullType (
612608 schema : JSONSchemaNull ,
613609 required ?: boolean ,
614- meta ?: { parentRequired ?: string [ ] }
610+ _meta ?: { parentRequired ?: string [ ] }
615611 ) : AnyNode {
616612 let value : AnyNode = schemaNodeNull ( ) ;
617613 const actions : ActionNode [ ] = [ ] ;
@@ -784,7 +780,9 @@ class ValibotGenerator {
784780 case 'multipleOf' :
785781 return `multipleOf(${ node . value } )` ;
786782 case 'description' :
787- return node . value . includes ( "\n" ) ? `description(\`${ node . value } \`)` : `description("${ node . value } ")` ;
783+ return node . value . includes ( '\n' )
784+ ? `description(\`${ node . value } \`)`
785+ : `description("${ node . value } ")` ;
788786 case 'null' :
789787 return 'null()' ;
790788 case 'object' : {
0 commit comments