arrmatura 5.0.5 → 5.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/index.js +1 -1
- package/lib/xml.ts +1 -1
- package/package.json +1 -1
package/docs/index.js
CHANGED
|
@@ -158,7 +158,7 @@
|
|
|
158
158
|
/*!********************!*\
|
|
159
159
|
!*** ./lib/xml.ts ***!
|
|
160
160
|
\********************/
|
|
161
|
-
/*! no static exports found */function(e,r,n){Object.defineProperty(r,"__esModule",{value:!0}),r.xmlParse=r.skipQoutes=r.escapeXml=r.decodeXmlEntities=r.attributesToString=void 0,r.xmlStringify=function xmlStringify(e){var r=e.tag,n=e.attrs,o=e.nodes,i=void 0===o?[]:o,u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if("#text"===r)return""+u+C(String((null==n?void 0:n.text)||""));var a=j(n),l=i.map((function(e){return xmlStringify(e," "+u)})).join("\n");return u+"<"+r+a+(l?">\n"+l+"\n"+u+"</"+r+">":"/>")};var o=n(/*! ./scalar */"./lib/scalar.ts"),i=/([a-z][a-zA-Z0-9-:]+)(="[^"]*"|={[^}]*})?/g,u=/^\s*$/,a=/<!--((?!-->)[\s\S])*-->/g,l=/(<)(\/?)([a-zа-я][a-zа-я0-9-:]*)((?:\s+[a-z][a-z0-9-:]+(?:="[^"]*"|={[^}]*})?)*)\s*(\/?)>/gi,s={img:1,input:1,br:1,col:1},c=/&#?[0-9a-z]{3,5};/g,f={amp:"&",gt:">",lt:"<",quot:'"',nbsp:" "},p={34:""",38:"&",39:"'",60:"<",62:">"},m=/["'&<>]/g,h=function FN_ESCAPE_XML_ENTITY(e){return p[e.charCodeAt(0)]},y=function FN_XML_ENTITY(e){var r=e.substring(1,e.length-1);return"#"===r[0]?String.fromCharCode(+r.slice(1)):f[r]||" "},b=function skipQoutes(e){return'"'===e[0]&&'"'===e[e.length-1]?e.slice(1,-1):e};r.skipQoutes=b;var v=function decodeXmlEntities(){
|
|
161
|
+
/*! no static exports found */function(e,r,n){Object.defineProperty(r,"__esModule",{value:!0}),r.xmlParse=r.skipQoutes=r.escapeXml=r.decodeXmlEntities=r.attributesToString=void 0,r.xmlStringify=function xmlStringify(e){var r=e.tag,n=e.attrs,o=e.nodes,i=void 0===o?[]:o,u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if("#text"===r)return""+u+C(String((null==n?void 0:n.text)||""));var a=j(n),l=i.map((function(e){return xmlStringify(e," "+u)})).join("\n");return u+"<"+r+a+(l?">\n"+l+"\n"+u+"</"+r+">":"/>")};var o=n(/*! ./scalar */"./lib/scalar.ts"),i=/([a-z][a-zA-Z0-9-:]+)(="[^"]*"|={[^}]*})?/g,u=/^\s*$/,a=/<!--((?!-->)[\s\S])*-->/g,l=/(<)(\/?)([a-zа-я][a-zа-я0-9-:]*)((?:\s+[a-z][a-z0-9-:]+(?:="[^"]*"|={[^}]*})?)*)\s*(\/?)>/gi,s={img:1,input:1,br:1,col:1},c=/&#?[0-9a-z]{3,5};/g,f={amp:"&",gt:">",lt:"<",quot:'"',nbsp:" "},p={34:""",38:"&",39:"'",60:"<",62:">"},m=/["'&<>]/g,h=function FN_ESCAPE_XML_ENTITY(e){return p[e.charCodeAt(0)]},y=function FN_XML_ENTITY(e){var r=e.substring(1,e.length-1);return"#"===r[0]?String.fromCharCode(+r.slice(1)):f[r]||" "},b=function skipQoutes(e){return'"'===e[0]&&'"'===e[e.length-1]?e.slice(1,-1):e};r.skipQoutes=b;var v=function decodeXmlEntities(e){return String(e||"").replace(c,y)};r.decodeXmlEntities=v;var g=function addNode(e,r){var n={tag:r};return(e.nodes||(e.nodes=[])).push(n),n},_=function parseAttrs(e,r){if(r){e.attrs={};for(var n=i.exec(r);n;n=i.exec(r)){var u=!n[2]||(0,o.scalarParse)(v(b(n[2].slice(1))));e.attrs[n[1]]=u}}},C=function escapeXml(e){return e?(""+e).replace(m,h):""};r.escapeXml=C;var j=function attributesToString(e){return"object"==typeof e?Array.isArray(e)?e.length?"["+attributesToString(e[0])+" x"+e.length+"]":"[]":"{"+Object.keys(e).toString()+"}":e};r.attributesToString=j;r.xmlParse=function xmlParse(e){for(var r=[{tag:"#root"}],n=String(e).trim().replace(a,""),o=0,i=l.exec(n);i;i=l.exec(n)){var c=i.index&&n.slice(o,i.index);if(c&&!c.match(u))g(r[0],"#text").attrs={text:v(c)};if(i[2]){if(r[0].tag!==i[3])throw new Error(" XML Parse closing tag does not match at: "+i.index+" near "+i.input.slice(Math.max(i.index-150,0),i.index)+"^^^^"+i.input.slice(i.index,Math.min(i.index+150,i.input.length)));r.shift()}else{var f=g(r[0],i[3]);if(_(f,i[4].trim()),!i[5]&&!(i[3]in s)&&(r.unshift(f),1===r.length))throw new Error("Parse error at: "+i[0])}o=l.lastIndex}return r[0].nodes||[]}},"./node_modules/@babel/runtime/helpers/arrayLikeToArray.js":
|
|
162
162
|
/*!*****************************************************************!*\
|
|
163
163
|
!*** ./node_modules/@babel/runtime/helpers/arrayLikeToArray.js ***!
|
|
164
164
|
\*****************************************************************/
|
package/lib/xml.ts
CHANGED
|
@@ -34,7 +34,7 @@ const FN_XML_ENTITY = function (s0: string) {
|
|
|
34
34
|
|
|
35
35
|
export const skipQoutes = (s: string) => (s[0] === '"' && s[s.length - 1] === '"' ? s.slice(1, -1) : s);
|
|
36
36
|
|
|
37
|
-
export const decodeXmlEntities = (s
|
|
37
|
+
export const decodeXmlEntities = (s?: string) => String(s || '').replace(RE_XML_ENTITY, FN_XML_ENTITY);
|
|
38
38
|
|
|
39
39
|
const addNode = (c: XmlNode, tag: string) => {
|
|
40
40
|
const node: XmlNode = { tag };
|