Comparing version 3.4.0 to 3.4.1
@@ -0,1 +1,11 @@ | ||
#### 3.4.1 (2021-03-18) | ||
##### Continuous Integration | ||
* **dependencies:** Fix npm audit ([c6d9739f](https://github.com/x2js/x2js/commit/c6d9739f226db2895fd657a7a06424761fde8f2f)) | ||
##### Documentation Changes | ||
* **licensing:** [#89](https://github.com/x2js/x2js/pull/89) - Add license file ([72168aad](https://github.com/x2js/x2js/commit/72168aadd5882763b5f954e879f6ce86fc86149e)) | ||
#### 3.4.0 (2019-11-26) | ||
@@ -5,7 +15,7 @@ | ||
* **keepTextConfig:** Add config to always generate text node with __text. ([88a3a2e7](https://github.com/Axinom/x2js/commit/88a3a2e7864db976bdd8ffddaabab51a169e175a)) | ||
* **keepTextConfig:** Add config to always generate text node with __text. ([88a3a2e7](https://github.com/x2js/x2js/commit/88a3a2e7864db976bdd8ffddaabab51a169e175a)) | ||
##### Bug Fixes | ||
* **parseXml:** [#74](https://github.com/Axinom/x2js/pull/74) Fix old IE compatibility check ([a96daa14](https://github.com/Axinom/x2js/commit/a96daa1480c63604c0d9e1882c4b890f9ba0f0f7)) | ||
* **parseXml:** [#74](https://github.com/x2js/x2js/pull/74) Fix old IE compatibility check ([a96daa14](https://github.com/x2js/x2js/commit/a96daa1480c63604c0d9e1882c4b890f9ba0f0f7)) | ||
@@ -16,3 +26,3 @@ #### 3.3.1 (2019-07-15) | ||
* **parseXml:** [#74](https://github.com/Axinom/x2js/pull/74) Fix old IE compatibility check ([a96daa14](https://github.com/Axinom/x2js/commit/a96daa1480c63604c0d9e1882c4b890f9ba0f0f7)) | ||
* **parseXml:** [#74](https://github.com/x2js/x2js/pull/74) Fix old IE compatibility check ([a96daa14](https://github.com/x2js/x2js/commit/a96daa1480c63604c0d9e1882c4b890f9ba0f0f7)) | ||
@@ -24,3 +34,3 @@ #### 3.2.6 (2019-01-24) | ||
* **config:** [#80](https://github.com/Axinom/x2js/pull/80) Add minified dist ([4d7b1bdb](https://github.com/Axinom/x2js/commit/4d7b1bdb3eca938afa45ed454d45e7478f43ceea)) | ||
* **config:** [#80](https://github.com/x2js/x2js/pull/80) Add minified dist ([4d7b1bdb](https://github.com/x2js/x2js/commit/4d7b1bdb3eca938afa45ed454d45e7478f43ceea)) | ||
@@ -31,13 +41,13 @@ #### 3.2.3 (2018-11-06) | ||
* **NPM:** Public access for deploy ([63adc548](https://github.com/Axinom/x2js/commit/63adc548ecd51201b35f534fca6bd35d9a8b7ed1)) | ||
* **NPM:** Public access for deploy ([63adc548](https://github.com/x2js/x2js/commit/63adc548ecd51201b35f534fca6bd35d9a8b7ed1)) | ||
* **Travis:** | ||
* Skip cleanup ([3d679cf9](https://github.com/Axinom/x2js/commit/3d679cf95033fc1fda806807b24570641b3771d8)) | ||
* Fix NPM login ([68d13a74](https://github.com/Axinom/x2js/commit/68d13a7433cdff80e8c4f179c03dd3354abdf5e5)) | ||
* NPM Deploy automatically ([fb197e59](https://github.com/Axinom/x2js/commit/fb197e59f68fa6902c868e8a6ef2c0d8d0ba44c3)) | ||
* **Package:** Fix indent ([520e9d5d](https://github.com/Axinom/x2js/commit/520e9d5d84982477cfbb5866314fb9438f97cccd)) | ||
* Skip cleanup ([3d679cf9](https://github.com/x2js/x2js/commit/3d679cf95033fc1fda806807b24570641b3771d8)) | ||
* Fix NPM login ([68d13a74](https://github.com/x2js/x2js/commit/68d13a7433cdff80e8c4f179c03dd3354abdf5e5)) | ||
* NPM Deploy automatically ([fb197e59](https://github.com/x2js/x2js/commit/fb197e59f68fa6902c868e8a6ef2c0d8d0ba44c3)) | ||
* **Package:** Fix indent ([520e9d5d](https://github.com/x2js/x2js/commit/520e9d5d84982477cfbb5866314fb9438f97cccd)) | ||
##### Bug Fixes | ||
* **json2XML:** deal with falsey __text values with attributes ([bd3997b4](https://github.com/Axinom/x2js/commit/bd3997b47ad72e3398fbaaabe5ad46ca393b745a)) | ||
* **xml2js:** Attributes were lost when keepCData property was true [#73](https://github.com/Axinom/x2js/pull/73) ([c046e355](https://github.com/Axinom/x2js/commit/c046e35556e0531be2309ace7adc4cf0c0f35036)) | ||
* **json2XML:** deal with falsey __text values with attributes ([bd3997b4](https://github.com/x2js/x2js/commit/bd3997b47ad72e3398fbaaabe5ad46ca393b745a)) | ||
* **xml2js:** Attributes were lost when keepCData property was true [#73](https://github.com/x2js/x2js/pull/73) ([c046e355](https://github.com/x2js/x2js/commit/c046e35556e0531be2309ace7adc4cf0c0f35036)) | ||
@@ -44,0 +54,0 @@ ### 3.2.2 (2018-05-17) |
@@ -1,2 +0,2 @@ | ||
!function(t,e){"use strict";"function"==typeof define&&define.amd?define([],e):"object"==typeof module&&module.exports?module.exports=e(require("xmldom").DOMParser):t.X2JS=e()}(this,function(y){"use strict";return function(d){(d=d||{}).arrayAccessForm=d.arrayAccessForm||"none",d.emptyNodeForm=d.emptyNodeForm||"text",d.jsAttributeFilter=d.jsAttributeFilter,d.jsAttributeConverter=d.jsAttributeConverter,d.attributeConverters=d.attributeConverters||[],d.datetimeAccessFormPaths=d.datetimeAccessFormPaths||[],d.arrayAccessFormPaths=d.arrayAccessFormPaths||[],d.xmldomOptions=d.xmldomOptions||{},void 0===d.enableToStringFunc&&(d.enableToStringFunc=!0),void 0===d.skipEmptyTextNodesForObj&&(d.skipEmptyTextNodesForObj=!0),void 0===d.stripWhitespaces&&(d.stripWhitespaces=!0),void 0===d.useDoubleQuotes&&(d.useDoubleQuotes=!0),void 0===d.ignoreRoot&&(d.ignoreRoot=!1),void 0===d.escapeMode&&(d.escapeMode=!0),void 0===d.attributePrefix&&(d.attributePrefix="_"),void 0===d.selfClosingElements&&(d.selfClosingElements=!0),void 0===d.keepCData&&(d.keepCData=!1),void 0===d.keepText&&(d.keepText=!1),void 0===d.jsDateUTC&&(d.jsDateUTC=!1),function(){function t(t){var e=String(t);return 1===e.length&&(e="0"+e),e}"function"!=typeof String.prototype.trim&&(String.prototype.trim=function(){return this.replace(/^\s+|^\n+|(\s|\n)+$/g,"")}),"function"!=typeof Date.prototype.toISOString&&(Date.prototype.toISOString=function(){return this.getUTCFullYear()+"-"+t(this.getUTCMonth()+1)+"-"+t(this.getUTCDate())+"T"+t(this.getUTCHours())+":"+t(this.getUTCMinutes())+":"+t(this.getUTCSeconds())+"."+String((this.getUTCMilliseconds()/1e3).toFixed(3)).slice(2,5)+"Z"})}();var p={ELEMENT_NODE:1,TEXT_NODE:3,CDATA_SECTION_NODE:4,COMMENT_NODE:8,DOCUMENT_NODE:9};function g(t){var e=t.localName;return null==e&&(e=t.baseName),null!=e&&""!==e||(e=t.nodeName),e}function c(t){return"string"==typeof t?t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"):t}function m(t,e,r){switch(d.arrayAccessForm){case"property":t[e]instanceof Array?t[e+"_asArray"]=t[e]:t[e+"_asArray"]=[t[e]]}if(!(t[e]instanceof Array)&&0<d.arrayAccessFormPaths.length){for(var n=!1,i=0;i<d.arrayAccessFormPaths.length;i++){var o=d.arrayAccessFormPaths[i];if("string"==typeof o){if(o===r){n=!0;break}}else if(o instanceof RegExp){if(o.test(r)){n=!0;break}}else if("function"==typeof o&&o(e,r)){n=!0;break}}n&&(t[e]=[t[e]])}}function x(t){var e=t.split(/[-T:+Z]/g),r=new Date(e[0],e[1]-1,e[2]),n=e[5].split(".");if(r.setHours(e[3],e[4],n[0]),1<n.length&&r.setMilliseconds(n[1]),e[6]&&e[7]){var i=60*e[6]+Number(e[7]);i=0+("-"===(/\d\d-\d\d:\d\d$/.test(t)?"-":"+")?-1*i:i),r.setMinutes(r.getMinutes()-i-r.getTimezoneOffset())}else-1!==t.indexOf("Z",t.length-1)&&(r=new Date(Date.UTC(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds())));return r}function r(t,e){for(var r={__cnt:0},n=t.childNodes,i=0;i<n.length;i++){var o=n.item(i),a=g(o);o.nodeType!==p.COMMENT_NODE&&(r.__cnt++,null==r[a]?(r[a]=h(o,e+"."+a),m(r,a,e+"."+a)):(r[a]instanceof Array||(r[a]=[r[a]],m(r,a,e+"."+a)),r[a][r[a].length]=h(o,e+"."+a)))}for(var s=0;s<t.attributes.length;s++){var c=t.attributes.item(s);r.__cnt++;for(var l=c.value,u=0;u<d.attributeConverters.length;u++){var f=d.attributeConverters[u];f.test.call(null,c.name,c.value)&&(l=f.convert.call(null,c.name,c.value))}r[d.attributePrefix+c.name]=l}var _=t.prefix;return _&&(r.__cnt++,r.__prefix=_),r["#text"]&&(r.__text=r["#text"],r.__text instanceof Array&&(r.__text=r.__text.join("\n")),d.escapeMode&&(r.__text=r.__text.replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/&/g,"&")),d.stripWhitespaces&&(r.__text=r.__text.trim()),delete r["#text"],"property"===d.arrayAccessForm&&delete r["#text_asArray"],r.__text=function(t,e,r){if(0<d.datetimeAccessFormPaths.length)for(var n=r.split(".#")[0],i=0;i<d.datetimeAccessFormPaths.length;i++){var o=d.datetimeAccessFormPaths[i];if("string"==typeof o){if(o===n)return x(t)}else if(o instanceof RegExp){if(o.test(n))return x(t)}else if("function"==typeof o&&o(n))return x(t)}return t}(r.__text,0,e+".#text")),r.hasOwnProperty("#cdata-section")&&(r.__cdata=r["#cdata-section"],delete r["#cdata-section"],"property"===d.arrayAccessForm&&delete r["#cdata-section_asArray"]),1===r.__cnt&&r.__text&&!d.keepText?r=r.__text:0===r.__cnt&&"text"===d.emptyNodeForm?r="":1<r.__cnt&&void 0!==r.__text&&d.skipEmptyTextNodesForObj&&(d.stripWhitespaces&&""===r.__text||""===r.__text.trim())&&delete r.__text,delete r.__cnt,d.keepCData||r.hasOwnProperty("__text")||!r.hasOwnProperty("__cdata")||1!==Object.keys(r).length?(d.enableToStringFunc&&(r.__text||r.__cdata)&&(r.toString=function(){return(this.__text?this.__text:"")+(this.__cdata?this.__cdata:"")}),r):r.__cdata?r.__cdata:""}function h(t,e){return t.nodeType===p.DOCUMENT_NODE?function(t){for(var e={},r=t.childNodes,n=0;n<r.length;n++){var i=r.item(n);if(i.nodeType===p.ELEMENT_NODE){var o=g(i);d.ignoreRoot?e=h(i,o):e[o]=h(i,o)}}return e}(t):t.nodeType===p.ELEMENT_NODE?r(t,e):t.nodeType===p.TEXT_NODE||t.nodeType===p.CDATA_SECTION_NODE?t.nodeValue:null}function o(t,e,r,n){var i="<"+(t&&t.__prefix?t.__prefix+":":"")+e;if(r)for(var o=0;o<r.length;o++){var a=r[o],s=t[a];d.escapeMode&&(s=c(s)),i+=" "+a.substr(d.attributePrefix.length)+"=",d.useDoubleQuotes?i+='"'+s+'"':i+="'"+s+"'"}return i+=n?" />":">"}function i(t,e){return"</"+(t&&t.__prefix?t.__prefix+":":"")+e+">"}function a(t,e){return"property"===d.arrayAccessForm&&(r=e.toString(),n="_asArray",-1!==r.indexOf(n,r.length-n.length))||0===e.toString().indexOf(d.attributePrefix)||0===e.toString().indexOf("__")||t[e]instanceof Function;var r,n}function s(t){var e=0;if(t instanceof Object)for(var r in t)a(t,r)||e++;return e}function l(t){var e=[];if(t instanceof Object)for(var r in t)-1===r.toString().indexOf("__")&&0===r.toString().indexOf(d.attributePrefix)&&e.push(r);return e}function u(t){var e,r,n="";return t instanceof Object?n+=(r="",(e=t).__cdata&&(r+="<![CDATA["+e.__cdata+"]]>"),(e.__text||"number"==typeof e.__text||"boolean"==typeof e.__text)&&(d.escapeMode?r+=c(e.__text):r+=e.__text),r):null!==t&&(d.escapeMode?n+=c(t):n+=t),n}function f(t,e,r){var n="";if(d.jsAttributeFilter&&d.jsAttributeFilter.call(null,e,t))return n;if(d.jsAttributeConverter&&(t=d.jsAttributeConverter.call(null,e,t)),null!=t&&""!==t||!d.selfClosingElements)if("object"==typeof t)if("[object Array]"===Object.prototype.toString.call(t))n+=function(t,e,r){var n="";if(0===t.length)n+=o(t,e,r,!0);else for(var i=0;i<t.length;i++)n+=f(t[i],e,l(t[i]));return n}(t,e,r);else if(t instanceof Date)n+=o(t,e,r,!1),n+=d.jsDateUTC?t.toUTCString():t.toISOString(),n+=i(t,e);else{0<s(t)||"number"==typeof t.__text||"boolean"==typeof t.__text||t.__text||t.__cdata?(n+=o(t,e,r,!1),n+=_(t),n+=i(t,e)):d.selfClosingElements?n+=o(t,e,r,!0):(n+=o(t,e,r,!1),n+=i(t,e))}else n+=o(t,e,r,!1),n+=u(t),n+=i(t,e);else n+=o(t,e,r,!0);return n}function _(t){var e="";if(0<s(t))for(var r in t)if(!a(t,r)){var n=t[r];e+=f(n,r,l(n))}return e+=u(t)}function n(t){if(void 0===t)return null;if("string"!=typeof t)return null;var e=null,r=null;if(y)r=(e=new y(d.xmldomOptions)).parseFromString(t,"text/xml");else if(window&&window.DOMParser){e=new window.DOMParser;var n=null;if(!(window.ActiveXObject||"ActiveXObject"in window)&&document.all&&!document.addEventListener)try{n=e.parseFromString("INVALID","text/xml").childNodes[0].namespaceURI}catch(t){n=null}try{r=e.parseFromString(t,"text/xml"),null!==n&&0<r.getElementsByTagNameNS(n,"parsererror").length&&(r=null)}catch(t){r=null}}else 0===t.indexOf("<?")&&(t=t.substr(t.indexOf("?>")+2)),(r=new ActiveXObject("Microsoft.XMLDOM")).async="false",r.loadXML(t);return r}this.asArray=function(t){return null==t?[]:t instanceof Array?t:[t]},this.toXmlDateTime=function(t){return t instanceof Date?t.toISOString():"number"==typeof t?new Date(t).toISOString():null},this.asDateTime=function(t){return"string"==typeof t?x(t):t},this.xml2dom=function(t){return n(t)},this.dom2js=function(t){return h(t,null)},this.js2dom=function(t){return n(this.js2xml(t))},this.xml2js=function(t){var e=n(t);return null!=e?this.dom2js(e):null},this.js2xml=function(t){return _(t)},this.getVersion=function(){return"3.4.0"}}}); | ||
!function(t,e){"use strict";"function"==typeof define&&define.amd?define([],e):"object"==typeof module&&module.exports?module.exports=e(require("xmldom").DOMParser):t.X2JS=e()}(this,function(h){"use strict";return function(p){function t(t){t=String(t);return t=1===t.length?"0"+t:t}(p=p||{}).arrayAccessForm=p.arrayAccessForm||"none",p.emptyNodeForm=p.emptyNodeForm||"text",p.jsAttributeFilter=p.jsAttributeFilter,p.jsAttributeConverter=p.jsAttributeConverter,p.attributeConverters=p.attributeConverters||[],p.datetimeAccessFormPaths=p.datetimeAccessFormPaths||[],p.arrayAccessFormPaths=p.arrayAccessFormPaths||[],p.xmldomOptions=p.xmldomOptions||{},void 0===p.enableToStringFunc&&(p.enableToStringFunc=!0),void 0===p.skipEmptyTextNodesForObj&&(p.skipEmptyTextNodesForObj=!0),void 0===p.stripWhitespaces&&(p.stripWhitespaces=!0),void 0===p.useDoubleQuotes&&(p.useDoubleQuotes=!0),void 0===p.ignoreRoot&&(p.ignoreRoot=!1),void 0===p.escapeMode&&(p.escapeMode=!0),void 0===p.attributePrefix&&(p.attributePrefix="_"),void 0===p.selfClosingElements&&(p.selfClosingElements=!0),void 0===p.keepCData&&(p.keepCData=!1),void 0===p.keepText&&(p.keepText=!1),void 0===p.jsDateUTC&&(p.jsDateUTC=!1),"function"!=typeof String.prototype.trim&&(String.prototype.trim=function(){return this.replace(/^\s+|^\n+|(\s|\n)+$/g,"")}),"function"!=typeof Date.prototype.toISOString&&(Date.prototype.toISOString=function(){return this.getUTCFullYear()+"-"+t(this.getUTCMonth()+1)+"-"+t(this.getUTCDate())+"T"+t(this.getUTCHours())+":"+t(this.getUTCMinutes())+":"+t(this.getUTCSeconds())+"."+String((this.getUTCMilliseconds()/1e3).toFixed(3)).slice(2,5)+"Z"});var d={ELEMENT_NODE:1,TEXT_NODE:3,CDATA_SECTION_NODE:4,COMMENT_NODE:8,DOCUMENT_NODE:9};function g(t){var e=t.localName;return e=null==(e=null==e?t.baseName:e)||""===e?t.nodeName:e}function c(t){return"string"==typeof t?t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"):t}function m(t,e,r){if("property"===p.arrayAccessForm&&(t[e]instanceof Array?t[e+"_asArray"]=t[e]:t[e+"_asArray"]=[t[e]]),!(t[e]instanceof Array)&&0<p.arrayAccessFormPaths.length){for(var n=!1,i=0;i<p.arrayAccessFormPaths.length;i++){var o=p.arrayAccessFormPaths[i];if("string"==typeof o){if(o===r){n=!0;break}}else if(o instanceof RegExp){if(o.test(r)){n=!0;break}}else if("function"==typeof o&&o(e,r)){n=!0;break}}n&&(t[e]=[t[e]])}}function x(t){var e=t.split(/[-T:+Z]/g),r=new Date(e[0],e[1]-1,e[2]),n=e[5].split(".");return r.setHours(e[3],e[4],n[0]),1<n.length&&r.setMilliseconds(n[1]),e[6]&&e[7]?(e=60*e[6]+Number(e[7]),e=0+("-"==(/\d\d-\d\d:\d\d$/.test(t)?"-":"+")?-1*e:e),r.setMinutes(r.getMinutes()-e-r.getTimezoneOffset())):-1!==t.indexOf("Z",t.length-1)&&(r=new Date(Date.UTC(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()))),r}function r(t,e){for(var r={__cnt:0},n=t.childNodes,i=0;i<n.length;i++){var o=n.item(i),a=g(o);o.nodeType!==d.COMMENT_NODE&&(r.__cnt++,null==r[a]?(r[a]=y(o,e+"."+a),m(r,a,e+"."+a)):(r[a]instanceof Array||(r[a]=[r[a]],m(r,a,e+"."+a)),r[a][r[a].length]=y(o,e+"."+a)))}for(var s=0;s<t.attributes.length;s++){var c=t.attributes.item(s);r.__cnt++;for(var l=c.value,u=0;u<p.attributeConverters.length;u++){var f=p.attributeConverters[u];f.test.call(null,c.name,c.value)&&(l=f.convert.call(null,c.name,c.value))}r[p.attributePrefix+c.name]=l}var _=t.prefix;return _&&(r.__cnt++,r.__prefix=_),r["#text"]&&(r.__text=r["#text"],r.__text instanceof Array&&(r.__text=r.__text.join("\n")),p.escapeMode&&(r.__text=r.__text.replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/&/g,"&")),p.stripWhitespaces&&(r.__text=r.__text.trim()),delete r["#text"],"property"===p.arrayAccessForm&&delete r["#text_asArray"],r.__text=function(t,e){if(0<p.datetimeAccessFormPaths.length)for(var r=e.split(".#")[0],n=0;n<p.datetimeAccessFormPaths.length;n++){var i=p.datetimeAccessFormPaths[n];if("string"==typeof i){if(i===r)return x(t)}else if(i instanceof RegExp){if(i.test(r))return x(t)}else if("function"==typeof i&&i(r))return x(t)}return t}(r.__text,e+".#text")),r.hasOwnProperty("#cdata-section")&&(r.__cdata=r["#cdata-section"],delete r["#cdata-section"],"property"===p.arrayAccessForm&&delete r["#cdata-section_asArray"]),1===r.__cnt&&r.__text&&!p.keepText?r=r.__text:0===r.__cnt&&"text"===p.emptyNodeForm?r="":1<r.__cnt&&void 0!==r.__text&&p.skipEmptyTextNodesForObj&&(p.stripWhitespaces&&""===r.__text||""===r.__text.trim())&&delete r.__text,delete r.__cnt,p.keepCData||r.hasOwnProperty("__text")||!r.hasOwnProperty("__cdata")||1!==Object.keys(r).length?(p.enableToStringFunc&&(r.__text||r.__cdata)&&(r.toString=function(){return(this.__text||"")+(this.__cdata||"")}),r):r.__cdata||""}function y(t,e){return t.nodeType===d.DOCUMENT_NODE?function(t){for(var e={},r=t.childNodes,n=0;n<r.length;n++){var i,o=r.item(n);o.nodeType===d.ELEMENT_NODE&&(i=g(o),p.ignoreRoot?e=y(o,i):e[i]=y(o,i))}return e}(t):t.nodeType===d.ELEMENT_NODE?r(t,e):t.nodeType===d.TEXT_NODE||t.nodeType===d.CDATA_SECTION_NODE?t.nodeValue:null}function o(t,e,r,n){var i="<"+(t&&t.__prefix?t.__prefix+":":"")+e;if(r)for(var o=0;o<r.length;o++){var a=r[o],s=t[a];p.escapeMode&&(s=c(s)),i+=" "+a.substr(p.attributePrefix.length)+"=",p.useDoubleQuotes?i+='"'+s+'"':i+="'"+s+"'"}return i+=n?" />":">"}function i(t,e){return"</"+(t&&t.__prefix?t.__prefix+":":"")+e+">"}function a(t,e){return"property"===p.arrayAccessForm&&(r=e.toString(),n="_asArray",-1!==r.indexOf(n,r.length-n.length))||0===e.toString().indexOf(p.attributePrefix)||0===e.toString().indexOf("__")||t[e]instanceof Function;var r,n}function s(t){var e=0;if(t instanceof Object)for(var r in t)a(t,r)||e++;return e}function l(t){var e=[];if(t instanceof Object)for(var r in t)-1===r.toString().indexOf("__")&&0===r.toString().indexOf(p.attributePrefix)&&e.push(r);return e}function u(t){var e,r,n="";return t instanceof Object?n+=(r="",(e=t).__cdata&&(r+="<![CDATA["+e.__cdata+"]]>"),!e.__text&&"number"!=typeof e.__text&&"boolean"!=typeof e.__text||(p.escapeMode?r+=c(e.__text):r+=e.__text),r):null!==t&&(p.escapeMode?n+=c(t):n+=t),n}function f(t,e,r){var n="";return p.jsAttributeFilter&&p.jsAttributeFilter.call(null,e,t)||(null!=(t=p.jsAttributeConverter?p.jsAttributeConverter.call(null,e,t):t)&&""!==t||!p.selfClosingElements?"object"==typeof t?"[object Array]"===Object.prototype.toString.call(t)?n+=function(t,e,r){var n="";if(0===t.length)n+=o(t,e,r,!0);else for(var i=0;i<t.length;i++)n+=f(t[i],e,l(t[i]));return n}(t,e,r):t instanceof Date?(n+=o(t,e,r,!1),n+=p.jsDateUTC?t.toUTCString():t.toISOString(),n+=i(t,e)):0<s(t)||"number"==typeof t.__text||"boolean"==typeof t.__text||t.__text||t.__cdata?(n+=o(t,e,r,!1),n+=_(t),n+=i(t,e)):p.selfClosingElements?n+=o(t,e,r,!0):(n+=o(t,e,r,!1),n+=i(t,e)):(n+=o(t,e,r,!1),n+=u(t),n+=i(t,e)):n+=o(t,e,r,!0)),n}function _(t){var e,r="";if(0<s(t))for(var n in t)a(t,n)||(r+=f(e=t[n],n,l(e)));return r+=u(t)}function e(t){if(void 0===t)return null;if("string"!=typeof t)return null;var e=null,r=null;if(h)r=(e=new h(p.xmldomOptions)).parseFromString(t,"text/xml");else if(window&&window.DOMParser){var e=new window.DOMParser,n=null;if(!(window.ActiveXObject||"ActiveXObject"in window)&&document.all&&!document.addEventListener)try{n=e.parseFromString("INVALID","text/xml").childNodes[0].namespaceURI}catch(t){n=null}try{r=e.parseFromString(t,"text/xml"),null!==n&&0<r.getElementsByTagNameNS(n,"parsererror").length&&(r=null)}catch(t){r=null}}else 0===t.indexOf("<?")&&(t=t.substr(t.indexOf("?>")+2)),(r=new ActiveXObject("Microsoft.XMLDOM")).async="false",r.loadXML(t);return r}this.asArray=function(t){return null==t?[]:t instanceof Array?t:[t]},this.toXmlDateTime=function(t){return t instanceof Date?t.toISOString():"number"==typeof t?new Date(t).toISOString():null},this.asDateTime=function(t){return"string"==typeof t?x(t):t},this.xml2dom=e,this.dom2js=function(t){return y(t,null)},this.js2dom=function(t){return e(this.js2xml(t))},this.xml2js=function(t){t=e(t);return null!=t?this.dom2js(t):null},this.js2xml=_,this.getVersion=function(){return"3.4.0"}}}); | ||
//# sourceMappingURL=x2js.min.js.map |
{ | ||
"name": "x2js", | ||
"version": "3.4.0", | ||
"version": "3.4.1", | ||
"description": "Transforms between XML string and JavaScript object trees.", | ||
@@ -8,8 +8,8 @@ "main": "x2js.js", | ||
"dependencies": { | ||
"xmldom": "^0.1.19" | ||
"xmldom": "^0.5.0" | ||
}, | ||
"devDependencies": { | ||
"eslint": "^3.4.0", | ||
"eslint": "^4.18.2", | ||
"eslint-config-axinom": "^1.0.3", | ||
"karma": "^1.2.0", | ||
"karma": "^6.2.0", | ||
"karma-chrome-launcher": "^2.0.0", | ||
@@ -20,3 +20,3 @@ "karma-firefox-launcher": "^1.0.0", | ||
"qunit-cli": "^0.2.0", | ||
"qunitjs": "^2.0.1", | ||
"qunitjs": "^2.4.1", | ||
"rimraf": "^2.6.3", | ||
@@ -32,3 +32,3 @@ "uglify-js": "^3.4.9" | ||
"type": "git", | ||
"url": "git+https://github.com/Axinom/x2js.git" | ||
"url": "git+https://github.com/x2js/x2js.git" | ||
}, | ||
@@ -45,5 +45,5 @@ "keywords": [ | ||
"bugs": { | ||
"url": "https://github.com/Axinom/x2js/issues" | ||
"url": "https://github.com/x2js/x2js/issues" | ||
}, | ||
"homepage": "https://github.com/Axinom/x2js#readme", | ||
"homepage": "https://github.com/x2js/x2js#readme", | ||
"eslintConfig": { | ||
@@ -50,0 +50,0 @@ "extends": "axinom", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
129840
19
1
80
+ Addedxmldom@0.5.0(transitive)
- Removedxmldom@0.1.31(transitive)
Updatedxmldom@^0.5.0