Skip to content

Commit

Permalink
fix: clone issue
Browse files Browse the repository at this point in the history
  • Loading branch information
citrizon committed Dec 21, 2024
1 parent 2c3a1e5 commit 92ca6b4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ function clone(obj) {
for ( key in obj ) {
if ( obj.hasOwnProperty( key ) ) {
val = obj[ key ];
if ( typeof val === 'object' && val !== null )
if ( Array.isArray( val ) && val !== null )
ret[ key ] = val.map( clone );
else if ( typeof val === 'object' && val !== null )
ret[ key ] = clone( val );
else ret[ key ] = val;
}
Expand Down

0 comments on commit 92ca6b4

Please sign in to comment.