@@ -17,7 +17,7 @@ export default function validateProjectionMode(options: ValidateProjectionOption
1717
1818 if ( ! projectionType ) {
1919
20- return [ new ValidationError ( 'projection-mode ' , projectionType , 'projection mode is missing' ) ] ;
20+ return [ new ValidationError ( 'projection.type ' , projectionType , 'value is missing' ) ] ;
2121 }
2222
2323 const rootType = getType ( projectionType ) ;
@@ -26,13 +26,11 @@ export default function validateProjectionMode(options: ValidateProjectionOption
2626 }
2727
2828 if ( rootType === 'string' && ! isPrimitiveProjection ( projectionType ) ) {
29- return [ new ValidationError ( 'projection-mode' , projectionType , 'does not fit the type PrimitiveProjection' ) ] ;
30- } else if ( rootType === 'object' && ! isProjectionTransition ( projectionType ) ) {
31- return [ new ValidationError ( 'projection-mode' , projectionType , 'does not fit the type ProjectionTransition' ) ] ;
29+ return [ new ValidationError ( 'projection.type' , projectionType , `found "${ projectionType } ", expected "mercator" or "globe".` ) ] ;
3230 } else if ( rootType === 'array' && ! isProjectionType ( projectionType ) ) {
33- return [ new ValidationError ( 'projection-mode ' , projectionType , 'does not fit the type ProjectionType' ) ] ;
34- } else if ( ! [ 'array' , 'object' , ' string'] . includes ( rootType ) ) {
35- return [ new ValidationError ( 'projection-mode ' , projectionType , `expected array, object, string - found ${ rootType } ` ) ] ;
31+ return [ new ValidationError ( 'projection.type ' , projectionType , `incorrect syntax, found ${ JSON . parse ( projectionType ) } .` ) ] ;
32+ } else if ( ! [ 'array' , 'string' ] . includes ( rootType ) ) {
33+ return [ new ValidationError ( 'projection.type ' , projectionType , `found value of type " ${ rootType } ", expected string or array ` ) ] ;
3634 }
3735 return [ ] ;
3836}
0 commit comments