Skip to content

Commit e43a591

Browse files
committed
fixed #10, fixed #11, fixed #12
1 parent 28efe08 commit e43a591

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,17 @@ function recursiveCopy(target, customizer, clone, visited, reference) {
6161
value = target[key];
6262
index = indexOf(visited, value);
6363

64+
resultCopy = undefined;
65+
result = undefined;
66+
ref = undefined;
67+
6468
if (index === -1) {
6569
resultCopy = copy(value, customizer);
6670
result = (resultCopy !== null) ? resultCopy : value;
6771

6872
if (value !== null && /^(?:function|object)$/.test(typeof value)) {
6973
visited.push(value);
7074
reference.push(result);
71-
} else {
72-
ref = result;
7375
}
7476
} else {
7577
// circular reference

0 commit comments

Comments
 (0)