From 5d00ecfba1255b7db122ccb587af9ba1bc19474d Mon Sep 17 00:00:00 2001 From: Arda TANRIKULU Date: Sat, 30 Sep 2023 18:06:45 -0700 Subject: [PATCH] Fix `jObj.hasOwnProperty is not a function` (#613) * Fix `jObj.hasOwnProperty is not a function` * Update json2xml.js --- src/xmlbuilder/json2xml.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/xmlbuilder/json2xml.js b/src/xmlbuilder/json2xml.js index 6c3a95dd..5707ee0f 100644 --- a/src/xmlbuilder/json2xml.js +++ b/src/xmlbuilder/json2xml.js @@ -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)) {