File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
packages/contentstack-variants/src/utils Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -9,18 +9,18 @@ export function formatErrors(errors: any): string {
99 for ( const errorKey in errors ) {
1010 const errorValue = errors [ errorKey ] ;
1111 if ( Array . isArray ( errorValue ) ) {
12- errorMessages . push ( ...errorValue . map ( ( error : any ) => formatError ( errorKey , error ) ) ) ;
12+ errorMessages . push ( ...errorValue . map ( ( error : any ) => formatError ( error ) ) ) ;
1313 } else {
14- errorMessages . push ( formatError ( errorKey , errorValue ) ) ;
14+ errorMessages . push ( formatError ( errorValue ) ) ;
1515 }
1616 }
1717
1818 return errorMessages . join ( ' ' ) ;
1919}
2020
21- function formatError ( errorKey : string , error : any ) : string {
21+ function formatError ( error : any ) : string {
2222 if ( typeof error === 'object' ) {
23- return ` ${ errorKey } : ${ Object . values ( error ) . join ( ' ' ) } ` ;
23+ return Object . values ( error ) . join ( ' ' ) ;
2424 }
25- return ` ${ errorKey } : ${ error } ` ;
25+ return error ;
2626}
You can’t perform that action at this time.
0 commit comments