dataV-xunfei/fast-xml-parser.min.js

2 lines
15 KiB
JavaScript
Raw Permalink Normal View History

2023-10-11 20:39:47 +08:00
var parser=function(t){var e={};function r(a){if(e[a])return e[a].exports;var i=e[a]={i:a,l:!1,exports:{}};return t[a].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,a){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:a})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var a=Object.create(null);if(r.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(a,i,function(e){return t[e]}.bind(null,i));return a},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=2)}([function(t,e,r){"use strict";var a=function(t,e){var r=e.exec(t);return!(null==r)};e.isExist=function(t){return void 0!==t},e.isEmptyObject=function(t){return 0===Object.keys(t).length},e.merge=function(t,e){if(e)for(var r=Object.keys(e),a=r.length,i=0;i<a;i++)t[r[i]]=e[r[i]]},e.getValue=function(t){return e.isExist(t)?t:""},e.buildOptions=function(t,e,r){var a={};if(!t)return e;for(var i=0;i<r.length;i++)void 0!==t[r[i]]?a[r[i]]=t[r[i]]:a[r[i]]=e[r[i]];return a},e.doesMatch=a,e.doesNotMatch=function(t,e){return!a(t,e)},e.getAllMatches=function(t,e){for(var r=[],a=e.exec(t);a;){for(var i=[],n=a.length,s=0;s<n;s++)i.push(a[s]);r.push(i),a=e.exec(t)}return r}},function(t,e,r){"use strict";var a=r(0),i=r(0).buildOptions,n=r(4),s={OPENING:1,CLOSING:2,SELF:3,CDATA:4},o="<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|(([\\w:\\-._]*:)?([\\w:\\-._]+))([^>]*)>|((\\/)(([\\w:\\-._]*:)?([\\w:\\-._]+))\\s*>))([^<]*)";!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt),!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);var l={attributeNamePrefix:"@_",attrNodeName:!1,textNodeName:"#text",ignoreAttributes:!0,ignoreNameSpace:!1,allowBooleanAttributes:!1,parseNodeValue:!0,parseAttributeValue:!1,arrayMode:!1,trimValues:!0,cdataTagName:!1,cdataPositionChar:"\\c",localeRange:"",tagValueProcessor:function(t){return t},attrValueProcessor:function(t){return t},stopNodes:[]};e.defaultOptions=l;var u=["attributeNamePrefix","attrNodeName","textNodeName","ignoreAttributes","ignoreNameSpace","allowBooleanAttributes","parseNodeValue","parseAttributeValue","arrayMode","trimValues","cdataTagName","cdataPositionChar","localeRange","tagValueProcessor","attrValueProcessor","parseTrueNumberOnly","stopNodes"];e.props=u;function c(t,e){return t&&(e.trimValues&&(t=t.trim()),t=h(t=e.tagValueProcessor(t),e.parseNodeValue,e.parseTrueNumberOnly)),t}function d(t,e){if(e.ignoreNameSpace){var r=t.split(":"),a="/"===t.charAt(0)?"/":"";if("xmlns"===r[0])return"";2===r.length&&(t=a+r[1])}return t}function h(t,e,r){var i;return e&&"string"==typeof t?(""===t.trim()||isNaN(t)?i="true"===t||"false"!==t&&t:(i=-1!==t.indexOf("0x")?Number.parseInt(t,16):-1!==t.indexOf(".")?Number.parseFloat(t):Number.parseInt(t,10),r&&(i=String(i)===t?i:t)),i):a.isExist(t)?t:""}var f=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])(.*?)\\3)?","g");function p(t,e){if(!e.ignoreAttributes&&"string"==typeof t){t=t.replace(/\r?\n/g," ");for(var r=a.getAllMatches(t,f),i=r.length,n={},s=0;s<i;s++){var o=d(r[s][1],e);o.length&&(void 0!==r[s][4]?(e.trimValues&&(r[s][4]=r[s][4].trim()),r[s][4]=e.attrValueProcessor(r[s][4]),n[e.attributeNamePrefix+o]=h(r[s][4],e.parseAttributeValue,e.parseTrueNumberOnly)):e.allowBooleanAttributes&&(n[e.attributeNamePrefix+o]=!0))}if(!Object.keys(n).length)return;if(e.attrNodeName){var l={};return l[e.attrNodeName]=n,l}return n}}e.getTraversalObj=function(t,e){e=i(e,l,u),t=t.replace(/<!--[\s\S]*?-->/g,"");var r=new n("!xml"),d=r;o=o.replace(/\[\\w/g,"["+e.localeRange+"\\w");for(var h=new RegExp(o,"g"),f=h.exec(t),g=h.exec(t);f;){var v="]]>"===(A=f)[4]?s.CDATA:"/"===A[10]?s.CLOSING:void 0!==A[8]&&"/"===A[8].substr(A[8].length-1)?s.SELF:s.O
//# sourceMappingURL=parser.min.js.map