Skip to content

Commit 8089f11

Browse files
committed
fix: use existence + comparison check for classes;
- fixes non-default value assignments
1 parent bbcb404 commit 8089f11

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: src/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default function klona(x) {
77
if (x.constructor !== Object && typeof x.constructor === 'function') {
88
tmp = new x.constructor();
99
for (k in x) {
10-
if (tmp[k] === void 0) {
10+
if (tmp.hasOwnProperty(k) && tmp[k] !== x[k]) {
1111
tmp[k] = klona(x[k]);
1212
}
1313
}

0 commit comments

Comments
 (0)