File tree Expand file tree Collapse file tree 1 file changed +21
-2
lines changed Expand file tree Collapse file tree 1 file changed +21
-2
lines changed Original file line number Diff line number Diff line change 4646 return ! node [ $scope . options . nodeChildren ] || node [ $scope . options . nodeChildren ] . length === 0 ;
4747 }
4848
49+ function shallowCopy ( src , dst ) {
50+ if ( angular . isArray ( src ) ) {
51+ dst = dst || [ ] ;
52+
53+ for ( var i = 0 ; i < src . length ; i ++ ) {
54+ dst [ i ] = src [ i ] ;
55+ }
56+ } else if ( angular . isObject ( src ) ) {
57+ dst = dst || { } ;
58+
59+ for ( var key in src ) {
60+ if ( hasOwnProperty . call ( src , key ) && ! ( key . charAt ( 0 ) === '$' && key . charAt ( 1 ) === '$' ) ) {
61+ dst [ key ] = src [ key ] ;
62+ }
63+ }
64+ }
65+
66+ return dst || src ;
67+ }
4968 function defaultEquality ( a , b ) {
5069 if ( a === undefined || b === undefined )
5170 return false ;
52- a = angular . copy ( a ) ;
71+ a = shallowCopy ( a ) ;
5372 a [ $scope . options . nodeChildren ] = [ ] ;
54- b = angular . copy ( b ) ;
73+ b = shallowCopy ( b ) ;
5574 b [ $scope . options . nodeChildren ] = [ ] ;
5675 return angular . equals ( a , b ) ;
5776 }
You can’t perform that action at this time.
0 commit comments