Skip to content

Commit 33b0fc3

Browse files
committedJan 21, 2020
Fix toObject again
1 parent 6b82e11 commit 33b0fc3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed
 

‎lib/schema.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -1418,8 +1418,10 @@
14181418
var keys = Object.keys(this.__data);
14191419
for (var i = 0; i < keys.length; i++) {
14201420
var key = keys[i];
1421-
data = data || {};
1422-
data[key] = this.__data[key];
1421+
if (this.__data[key]) {
1422+
data = data || {};
1423+
data[key] = this.__data[key];
1424+
}
14231425
}
14241426
}
14251427
return data;

0 commit comments

Comments
 (0)
Please sign in to comment.