Skip to content

Commit

Permalink
Fix jObj.hasOwnProperty is not a function (#613)
Browse files Browse the repository at this point in the history
* Fix `jObj.hasOwnProperty is not a function`

* Update json2xml.js
  • Loading branch information
ardatan committed Oct 1, 2023
1 parent 9504fac commit 5d00ecf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/xmlbuilder/json2xml.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Builder.prototype.j2x = function(jObj, level) {
let attrStr = '';
let val = '';
for (let key in jObj) {
if(!jObj.hasOwnProperty(key)) continue;
if(!Object.prototype.hasOwnProperty.call(jObj, key)) continue;
if (typeof jObj[key] === 'undefined') {
// supress undefined node only if it is not an attribute
if (this.isAttribute(key)) {
Expand Down

0 comments on commit 5d00ecf

Please sign in to comment.