@@ -93,7 +93,7 @@ function compileAnyOfSchema(compiler: Compiler, schema: OpenAPIAnyOfSchema) {
9393 ) ;
9494 } ) ;
9595
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' ) ) ) ;
9797
9898 return nodes ;
9999 } ) ;
@@ -147,7 +147,7 @@ function compileOneOfSchema(compiler: Compiler, schema: OpenAPIOneOfSchema) {
147147 ) ,
148148 builders . blockStatement ( [
149149 builders . returnStatement (
150- error ( 'Expected to only match one of the schemas' ) ,
150+ error ( 'expected to only match one of the schemas' ) ,
151151 ) ,
152152 ] ) ,
153153 ) ,
@@ -224,7 +224,7 @@ function compileObjectSchema(compiler: Compiler, schema: OpenAPIObjectSchema) {
224224 ) ,
225225 builders . binaryExpression ( '===' , value , builders . literal ( null ) ) ,
226226 ) ,
227- builders . blockStatement ( [ builders . returnStatement ( error ( 'Expected an object' ) ) ] ) ,
227+ builders . blockStatement ( [ builders . returnStatement ( error ( 'expected an object' ) ) ] ) ,
228228 ) ,
229229 ) ;
230230
@@ -259,7 +259,7 @@ function compileObjectSchema(compiler: Compiler, schema: OpenAPIObjectSchema) {
259259 ) ,
260260 builders . blockStatement ( [
261261 builders . returnStatement (
262- error ( `Expected at least ${ schema . minProperties } properties` ) ,
262+ error ( `expected at least ${ schema . minProperties } properties` ) ,
263263 ) ,
264264 ] ) ,
265265 ) ,
@@ -276,7 +276,7 @@ function compileObjectSchema(compiler: Compiler, schema: OpenAPIObjectSchema) {
276276 ) ,
277277 builders . blockStatement ( [
278278 builders . returnStatement (
279- error ( `Expected at most ${ schema . maxProperties } properties` ) ,
279+ error ( `expected at most ${ schema . maxProperties } properties` ) ,
280280 ) ,
281281 ] ) ,
282282 ) ,
@@ -354,7 +354,7 @@ function compileObjectSchema(compiler: Compiler, schema: OpenAPIObjectSchema) {
354354 builders . blockStatement ( check ) ,
355355 schema . required ?. includes ( key )
356356 ? builders . blockStatement ( [
357- builders . returnStatement ( error ( `Expected "${ key } " to be defined` ) ) ,
357+ builders . returnStatement ( error ( `expected "${ key } " to be defined` ) ) ,
358358 ] )
359359 : subSchema . default !== undefined
360360 ? builders . blockStatement ( [
@@ -381,7 +381,7 @@ function compileObjectSchema(compiler: Compiler, schema: OpenAPIObjectSchema) {
381381 builders . literal ( 0 ) ,
382382 ) ,
383383 builders . blockStatement ( [
384- builders . returnStatement ( error ( `Unexpected properties` ) ) ,
384+ builders . returnStatement ( error ( `unexpected properties` ) ) ,
385385 ] ) ,
386386 ) ,
387387 ) ;
@@ -465,7 +465,7 @@ function compileArraySchema(compiler: Compiler, schema: OpenAPIArraySchema) {
465465 [ value ] ,
466466 ) ,
467467 ) ,
468- builders . blockStatement ( [ builders . returnStatement ( error ( 'Expected an array' ) ) ] ) ,
468+ builders . blockStatement ( [ builders . returnStatement ( error ( 'expected an array' ) ) ] ) ,
469469 ) ,
470470 ) ;
471471
@@ -479,7 +479,7 @@ function compileArraySchema(compiler: Compiler, schema: OpenAPIArraySchema) {
479479 ) ,
480480 builders . blockStatement ( [
481481 builders . returnStatement (
482- error ( `Expected at least ${ schema . minItems } items` ) ,
482+ error ( `expected at least ${ schema . minItems } items` ) ,
483483 ) ,
484484 ] ) ,
485485 ) ,
@@ -496,7 +496,7 @@ function compileArraySchema(compiler: Compiler, schema: OpenAPIArraySchema) {
496496 ) ,
497497 builders . blockStatement ( [
498498 builders . returnStatement (
499- error ( `Expected at most ${ schema . maxItems } items` ) ,
499+ error ( `expected at most ${ schema . maxItems } items` ) ,
500500 ) ,
501501 ] ) ,
502502 ) ,
@@ -553,7 +553,7 @@ function compileArraySchema(compiler: Compiler, schema: OpenAPIArraySchema) {
553553 [ itemResult ] ,
554554 ) ,
555555 builders . blockStatement ( [
556- builders . returnStatement ( error ( `Expected unique items` ) ) ,
556+ builders . returnStatement ( error ( `expected unique items` ) ) ,
557557 ] ) ,
558558 ) ,
559559 builders . expressionStatement (
@@ -611,7 +611,7 @@ function compileNumberSchema(
611611 builders . unaryExpression ( 'typeof' , value ) ,
612612 builders . literal ( 'number' ) ,
613613 ) ,
614- builders . blockStatement ( [ builders . returnStatement ( error ( 'Expected a number' ) ) ] ) ,
614+ builders . blockStatement ( [ builders . returnStatement ( error ( 'expected a number' ) ) ] ) ,
615615 ) ,
616616 ) ;
617617
@@ -637,7 +637,7 @@ function compileStringSchema(compiler: Compiler, schema: OpenAPIStringSchema) {
637637 builders . unaryExpression ( 'typeof' , value ) ,
638638 builders . literal ( 'string' ) ,
639639 ) ,
640- builders . blockStatement ( [ builders . returnStatement ( error ( 'Expected a string' ) ) ] ) ,
640+ builders . blockStatement ( [ builders . returnStatement ( error ( 'expected a string' ) ) ] ) ,
641641 ) ,
642642 ) ;
643643
@@ -689,7 +689,7 @@ function compileStringSchema(compiler: Compiler, schema: OpenAPIStringSchema) {
689689 ) ,
690690 builders . blockStatement ( [
691691 builders . returnStatement (
692- error ( `Expected at least ${ schema . minLength } characters` ) ,
692+ error ( `expected at least ${ schema . minLength } characters` ) ,
693693 ) ,
694694 ] ) ,
695695 ) ,
@@ -706,7 +706,7 @@ function compileStringSchema(compiler: Compiler, schema: OpenAPIStringSchema) {
706706 ) ,
707707 builders . blockStatement ( [
708708 builders . returnStatement (
709- error ( `Expected at most ${ schema . maxLength } characters` ) ,
709+ error ( `expected at most ${ schema . maxLength } characters` ) ,
710710 ) ,
711711 ] ) ,
712712 ) ,
@@ -737,7 +737,7 @@ function compileStringSchema(compiler: Compiler, schema: OpenAPIStringSchema) {
737737 ) ,
738738 builders . blockStatement ( [
739739 builders . returnStatement (
740- error ( `Expected to match the pattern "${ schema . pattern } "` ) ,
740+ error ( `expected to match the pattern "${ schema . pattern } "` ) ,
741741 ) ,
742742 ] ) ,
743743 ) ,
@@ -766,7 +766,7 @@ function compileBooleanSchema(compiler: Compiler, schema: OpenAPIBooleanSchema)
766766 builders . unaryExpression ( 'typeof' , value ) ,
767767 builders . literal ( 'boolean' ) ,
768768 ) ,
769- builders . blockStatement ( [ builders . returnStatement ( error ( 'Expected a boolean' ) ) ] ) ,
769+ builders . blockStatement ( [ builders . returnStatement ( error ( 'expected a boolean' ) ) ] ) ,
770770 ) ,
771771 ) ;
772772
@@ -824,7 +824,7 @@ function compileEnumableCheck(
824824 null as namedTypes . BinaryExpression | namedTypes . LogicalExpression | null ,
825825 ) ! ,
826826 builders . blockStatement ( [
827- builders . returnStatement ( error ( 'Expected one of the enum value' ) ) ,
827+ builders . returnStatement ( error ( 'expected one of the enum value' ) ) ,
828828 ] ) ,
829829 ) ,
830830 builders . returnStatement ( value ) ,
0 commit comments