Skip to content

Commit b8bc91f

Browse files
committed
fix: properly clone arrays
1 parent 6f33893 commit b8bc91f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/utils/clone.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
export default function clone(obj) {
2+
if (Array.isArray(obj)) {
3+
return [...obj];
4+
}
25
if (typeof obj === 'object') {
36
return { ...obj };
47
}

0 commit comments

Comments
 (0)