@@ -93,7 +93,7 @@ function compileAnyOfSchema(compiler: Compiler, schema: OpenAPIAnyOfSchema) {
93
93
) ;
94
94
} ) ;
95
95
96
- nodes . push ( builders . returnStatement ( error ( 'Expected one of the anyOf schemas to match' ) ) ) ;
96
+ nodes . push ( builders . returnStatement ( error ( 'expected one of the anyOf schemas to match' ) ) ) ;
97
97
98
98
return nodes ;
99
99
} ) ;
@@ -147,7 +147,7 @@ function compileOneOfSchema(compiler: Compiler, schema: OpenAPIOneOfSchema) {
147
147
) ,
148
148
builders . blockStatement ( [
149
149
builders . returnStatement (
150
- error ( 'Expected to only match one of the schemas' ) ,
150
+ error ( 'expected to only match one of the schemas' ) ,
151
151
) ,
152
152
] ) ,
153
153
) ,
@@ -224,7 +224,7 @@ function compileObjectSchema(compiler: Compiler, schema: OpenAPIObjectSchema) {
224
224
) ,
225
225
builders . binaryExpression ( '===' , value , builders . literal ( null ) ) ,
226
226
) ,
227
- builders . blockStatement ( [ builders . returnStatement ( error ( 'Expected an object' ) ) ] ) ,
227
+ builders . blockStatement ( [ builders . returnStatement ( error ( 'expected an object' ) ) ] ) ,
228
228
) ,
229
229
) ;
230
230
@@ -259,7 +259,7 @@ function compileObjectSchema(compiler: Compiler, schema: OpenAPIObjectSchema) {
259
259
) ,
260
260
builders . blockStatement ( [
261
261
builders . returnStatement (
262
- error ( `Expected at least ${ schema . minProperties } properties` ) ,
262
+ error ( `expected at least ${ schema . minProperties } properties` ) ,
263
263
) ,
264
264
] ) ,
265
265
) ,
@@ -276,7 +276,7 @@ function compileObjectSchema(compiler: Compiler, schema: OpenAPIObjectSchema) {
276
276
) ,
277
277
builders . blockStatement ( [
278
278
builders . returnStatement (
279
- error ( `Expected at most ${ schema . maxProperties } properties` ) ,
279
+ error ( `expected at most ${ schema . maxProperties } properties` ) ,
280
280
) ,
281
281
] ) ,
282
282
) ,
@@ -354,7 +354,7 @@ function compileObjectSchema(compiler: Compiler, schema: OpenAPIObjectSchema) {
354
354
builders . blockStatement ( check ) ,
355
355
schema . required ?. includes ( key )
356
356
? builders . blockStatement ( [
357
- builders . returnStatement ( error ( `Expected "${ key } " to be defined` ) ) ,
357
+ builders . returnStatement ( error ( `expected "${ key } " to be defined` ) ) ,
358
358
] )
359
359
: subSchema . default !== undefined
360
360
? builders . blockStatement ( [
@@ -381,7 +381,7 @@ function compileObjectSchema(compiler: Compiler, schema: OpenAPIObjectSchema) {
381
381
builders . literal ( 0 ) ,
382
382
) ,
383
383
builders . blockStatement ( [
384
- builders . returnStatement ( error ( `Unexpected properties` ) ) ,
384
+ builders . returnStatement ( error ( `unexpected properties` ) ) ,
385
385
] ) ,
386
386
) ,
387
387
) ;
@@ -465,7 +465,7 @@ function compileArraySchema(compiler: Compiler, schema: OpenAPIArraySchema) {
465
465
[ value ] ,
466
466
) ,
467
467
) ,
468
- builders . blockStatement ( [ builders . returnStatement ( error ( 'Expected an array' ) ) ] ) ,
468
+ builders . blockStatement ( [ builders . returnStatement ( error ( 'expected an array' ) ) ] ) ,
469
469
) ,
470
470
) ;
471
471
@@ -479,7 +479,7 @@ function compileArraySchema(compiler: Compiler, schema: OpenAPIArraySchema) {
479
479
) ,
480
480
builders . blockStatement ( [
481
481
builders . returnStatement (
482
- error ( `Expected at least ${ schema . minItems } items` ) ,
482
+ error ( `expected at least ${ schema . minItems } items` ) ,
483
483
) ,
484
484
] ) ,
485
485
) ,
@@ -496,7 +496,7 @@ function compileArraySchema(compiler: Compiler, schema: OpenAPIArraySchema) {
496
496
) ,
497
497
builders . blockStatement ( [
498
498
builders . returnStatement (
499
- error ( `Expected at most ${ schema . maxItems } items` ) ,
499
+ error ( `expected at most ${ schema . maxItems } items` ) ,
500
500
) ,
501
501
] ) ,
502
502
) ,
@@ -553,7 +553,7 @@ function compileArraySchema(compiler: Compiler, schema: OpenAPIArraySchema) {
553
553
[ itemResult ] ,
554
554
) ,
555
555
builders . blockStatement ( [
556
- builders . returnStatement ( error ( `Expected unique items` ) ) ,
556
+ builders . returnStatement ( error ( `expected unique items` ) ) ,
557
557
] ) ,
558
558
) ,
559
559
builders . expressionStatement (
@@ -611,7 +611,7 @@ function compileNumberSchema(
611
611
builders . unaryExpression ( 'typeof' , value ) ,
612
612
builders . literal ( 'number' ) ,
613
613
) ,
614
- builders . blockStatement ( [ builders . returnStatement ( error ( 'Expected a number' ) ) ] ) ,
614
+ builders . blockStatement ( [ builders . returnStatement ( error ( 'expected a number' ) ) ] ) ,
615
615
) ,
616
616
) ;
617
617
@@ -637,7 +637,7 @@ function compileStringSchema(compiler: Compiler, schema: OpenAPIStringSchema) {
637
637
builders . unaryExpression ( 'typeof' , value ) ,
638
638
builders . literal ( 'string' ) ,
639
639
) ,
640
- builders . blockStatement ( [ builders . returnStatement ( error ( 'Expected a string' ) ) ] ) ,
640
+ builders . blockStatement ( [ builders . returnStatement ( error ( 'expected a string' ) ) ] ) ,
641
641
) ,
642
642
) ;
643
643
@@ -689,7 +689,7 @@ function compileStringSchema(compiler: Compiler, schema: OpenAPIStringSchema) {
689
689
) ,
690
690
builders . blockStatement ( [
691
691
builders . returnStatement (
692
- error ( `Expected at least ${ schema . minLength } characters` ) ,
692
+ error ( `expected at least ${ schema . minLength } characters` ) ,
693
693
) ,
694
694
] ) ,
695
695
) ,
@@ -706,7 +706,7 @@ function compileStringSchema(compiler: Compiler, schema: OpenAPIStringSchema) {
706
706
) ,
707
707
builders . blockStatement ( [
708
708
builders . returnStatement (
709
- error ( `Expected at most ${ schema . maxLength } characters` ) ,
709
+ error ( `expected at most ${ schema . maxLength } characters` ) ,
710
710
) ,
711
711
] ) ,
712
712
) ,
@@ -737,7 +737,7 @@ function compileStringSchema(compiler: Compiler, schema: OpenAPIStringSchema) {
737
737
) ,
738
738
builders . blockStatement ( [
739
739
builders . returnStatement (
740
- error ( `Expected to match the pattern "${ schema . pattern } "` ) ,
740
+ error ( `expected to match the pattern "${ schema . pattern } "` ) ,
741
741
) ,
742
742
] ) ,
743
743
) ,
@@ -766,7 +766,7 @@ function compileBooleanSchema(compiler: Compiler, schema: OpenAPIBooleanSchema)
766
766
builders . unaryExpression ( 'typeof' , value ) ,
767
767
builders . literal ( 'boolean' ) ,
768
768
) ,
769
- builders . blockStatement ( [ builders . returnStatement ( error ( 'Expected a boolean' ) ) ] ) ,
769
+ builders . blockStatement ( [ builders . returnStatement ( error ( 'expected a boolean' ) ) ] ) ,
770
770
) ,
771
771
) ;
772
772
@@ -824,7 +824,7 @@ function compileEnumableCheck(
824
824
null as namedTypes . BinaryExpression | namedTypes . LogicalExpression | null ,
825
825
) ! ,
826
826
builders . blockStatement ( [
827
- builders . returnStatement ( error ( 'Expected one of the enum value' ) ) ,
827
+ builders . returnStatement ( error ( 'expected one of the enum value' ) ) ,
828
828
] ) ,
829
829
) ,
830
830
builders . returnStatement ( value ) ,
0 commit comments