File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -520,19 +520,22 @@ const hasCollectionChanged = (oldCollection, newCollection) => {
520520 if ( [ oldCollection , newCollection ] . every ( ( a ) => Array . isArray ( a ) ) ) {
521521 if ( oldCollection . length !== newCollection . length ) return true ;
522522
523- return oldCollection . some ( ( oldVal , i ) => {
523+ for ( let i = 0 ; i < oldCollection . length ; i ++ ) {
524+ const oldVal = oldCollection [ i ] ;
524525 const newVal = newCollection [ i ] ;
525526 if ( oldVal !== newVal ) return isArrayOrObject ( oldVal , newVal ) ? hasCollectionChanged ( oldVal , newVal ) : true ;
526- } ) ;
527+ }
527528 } else {
528529 if ( Object . keys ( oldCollection ) . length !== Object . keys ( newCollection ) . length ) return true ;
529530
530- return Object . keys ( oldCollection ) . some ( ( k ) => {
531+ for ( const k in oldCollection ) {
531532 if ( k . startsWith ( '_' ) ) return false ;
532533 const oldVal = oldCollection [ k ] ;
533534 const newVal = newCollection [ k ] ;
534535 if ( oldVal !== newVal ) return isArrayOrObject ( oldVal , newVal ) ? hasCollectionChanged ( oldVal , newVal ) : true ;
535- } ) ;
536+ }
536537 }
538+
539+ return false ;
537540} ;
538541exports . hasCollectionChanged = hasCollectionChanged ;
You can’t perform that action at this time.
0 commit comments