File tree Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -29,15 +29,22 @@ const getModelItems = (wrapperComponent) => {
29
29
} ;
30
30
31
31
const extend = ( target , ...sources ) => {
32
- sources . forEach ( ( source ) => {
33
- for ( let key in source ) {
34
- if ( source . hasOwnProperty ( key ) ) {
35
- target [ key ] = source [ key ] ;
32
+ if ( target === undefined || target === null ) {
33
+ throw new TypeError ( 'Cannot convert undefined or null to object' ) ;
34
+ }
35
+
36
+ const output = Object ( target ) ;
37
+ for ( let index = 0 ; index < sources . length ; index ++ ) {
38
+ const source = sources [ index ] ;
39
+ if ( source !== undefined && source !== null ) {
40
+ for ( let key in source ) {
41
+ if ( source . hasOwnProperty ( key ) ) {
42
+ output [ key ] = source [ key ] ;
43
+ }
36
44
}
37
45
}
38
- } ) ;
39
-
40
- return target ;
46
+ }
47
+ return output ;
41
48
} ;
42
49
43
50
const SortableMixin = ( options = defaultOptions ) => ( Component ) => class extends React . Component {
You can’t perform that action at this time.
0 commit comments