File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed
Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ function validateSchema(schema, options) {
1717 const errors = options . map ( ( options ) => validateObject ( schema , options ) ) ;
1818 errors . forEach ( ( list , idx ) => {
1919 list . forEach ( function applyPrefix ( err ) {
20- err . dataPath = "[" + idx + "]" + err . dataPath ;
20+ err . dataPath = `[ ${ idx } ] ${ err . dataPath } ` ;
2121 if ( err . children ) {
2222 err . children . forEach ( applyPrefix ) ;
2323 }
@@ -45,9 +45,7 @@ function filterErrors(errors) {
4545 newErrors = newErrors . filter ( ( oldError ) => {
4646 if ( oldError . dataPath . includes ( dataPath ) ) {
4747 if ( oldError . children ) {
48- oldError . children . forEach ( ( child ) => {
49- children . push ( child ) ;
50- } ) ;
48+ children = children . concat ( oldError . children . slice ( 0 ) ) ;
5149 }
5250 oldError . children = undefined ;
5351 children . push ( oldError ) ;
You can’t perform that action at this time.
0 commit comments