Skip to content

Commit 5d00ecf

Browse files
authored
Fix jObj.hasOwnProperty is not a function (#613)
* Fix `jObj.hasOwnProperty is not a function` * Update json2xml.js
1 parent 9504fac commit 5d00ecf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: src/xmlbuilder/json2xml.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ Builder.prototype.j2x = function(jObj, level) {
7979
let attrStr = '';
8080
let val = '';
8181
for (let key in jObj) {
82-
if(!jObj.hasOwnProperty(key)) continue;
82+
if(!Object.prototype.hasOwnProperty.call(jObj, key)) continue;
8383
if (typeof jObj[key] === 'undefined') {
8484
// supress undefined node only if it is not an attribute
8585
if (this.isAttribute(key)) {

0 commit comments

Comments
 (0)