@@ -182,7 +182,7 @@ export class ValidationExecutor {
182182 }
183183
184184 this . customValidations ( object , value , customValidationMetadatas , validationError ) ;
185- this . nestedValidations ( value , nestedValidationMetadatas , validationError . children , definedMetadatas , metadatas ) ;
185+ this . nestedValidations ( value , nestedValidationMetadatas , validationError . children ) ;
186186
187187 this . mapContexts ( object , value , metadatas , validationError ) ;
188188 this . mapContexts ( object , value , customValidationMetadatas , validationError ) ;
@@ -304,8 +304,7 @@ export class ValidationExecutor {
304304 } ) ;
305305 }
306306
307- private nestedValidations ( value : any , metadatas : ValidationMetadata [ ] , errors : ValidationError [ ] ,
308- definedMetadatas : ValidationMetadata [ ] , allMetadatas : ValidationMetadata [ ] ) {
307+ private nestedValidations ( value : any , metadatas : ValidationMetadata [ ] , errors : ValidationError [ ] ) {
309308
310309 if ( value === void 0 ) {
311310 return ;
@@ -323,8 +322,9 @@ export class ValidationExecutor {
323322 // Treats Set as an array - as index of Set value is value itself and it is common case to have Object as value
324323 const arrayLikeValue = value instanceof Set ? Array . from ( value ) : value ;
325324 arrayLikeValue . forEach ( ( subValue : any , index : any ) => {
326- this . performValidations ( value , subValue , index . toString ( ) , definedMetadatas , allMetadatas , errors ) ;
325+ this . performValidations ( value , subValue , index . toString ( ) , [ ] , metadatas , errors ) ;
327326 } ) ;
327+
328328 } else if ( value instanceof Object ) {
329329 const targetSchema = typeof metadata . target === "string" ? metadata . target as string : metadata . target . name ;
330330 this . execute ( value , targetSchema , errors ) ;
0 commit comments