Socket
Socket
Sign inDemoInstall

saxen

Package Overview
Dependencies
0
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 8.0.0 to 8.1.0

33

CHANGELOG.md

@@ -9,2 +9,7 @@ # Changelog

## 8.1.0
* `FEAT`: warn on non-whitespace outside root node ([#11](https://github.com/nikku/saxen/issues/11), [#12](https://github.com/nikku/saxen/issues/12))
* `FEAT`: allow dots in tag names
## 8.0.0

@@ -41,3 +46,3 @@

* `FEAT`: recover from attribute parse errors [#13](https://github.com/nikku/saxen/issues/13)
* `FEAT`: recover from attribute parse errors ([#13](https://github.com/nikku/saxen/issues/13))

@@ -50,3 +55,3 @@ ## 6.0.0

* `FEAT`: detect and gracefully handle local attribute re-declarations that are forbidden via the XML spec: We'll now emit a warning and ignore the offending attribute [`7d0c8629`](https://github.com/nikku/saxen/commit/7d0c8629c6b7afe82953e86b7351ae30be41730c)
* `FEAT`: detect and gracefully handle local attribute re-declarations that are forbidden via the XML spec: We'll now emit a warning and ignore the offending attribute ([`7d0c8629`](https://github.com/nikku/saxen/commit/7d0c8629c6b7afe82953e86b7351ae30be41730c))

@@ -59,11 +64,11 @@ ## 5.6.0

* `FEAT`: expose `getContext` on all hooks [`634857b0`](https://github.com/nikku/saxen/commit/634857b0db8ac91d87520dfa6314cb67a4d05e5f)
* `FEAT`: expose `getContext` on all hooks ([`634857b0`](https://github.com/nikku/saxen/commit/634857b0db8ac91d87520dfa6314cb67a4d05e5f))
## 5.4.1
* `FIX`: bundle `decode.js` with published package [`528cd1c0`](https://github.com/nikku/saxen/commit/528cd1c0bbc1f2a76812b626cce87b3362ab1bb3)
* `FIX`: bundle `decode.js` with published package ([`528cd1c0`](https://github.com/nikku/saxen/commit/528cd1c0bbc1f2a76812b626cce87b3362ab1bb3))
## 5.4.0
* `CHORE`: configure hooks only if actually used [`5ab3e2ee`](https://github.com/nikku/saxen/commit/066e712dd89f15f913387b40f0198575e1083d2f)
* `CHORE`: configure hooks only if actually used ([`5ab3e2ee`](https://github.com/nikku/saxen/commit/066e712dd89f15f913387b40f0198575e1083d2f))

@@ -76,3 +81,3 @@ ## 5.3.1

* `CHORE`: simplify and speed up entity decoding [`066e712d`](https://github.com/nikku/saxen/commit/066e712dd89f15f913387b40f0198575e1083d2f)
* `CHORE`: simplify and speed up entity decoding ([`066e712d`](https://github.com/nikku/saxen/commit/066e712dd89f15f913387b40f0198575e1083d2f))

@@ -85,3 +90,3 @@ ## 5.2.0

* `FEAT`: proxy mode exposes clonable view [`73c6c44a`](https://github.com/nikku/saxen/commit/73c6c44ade3127f3819ceb825e241bb39d74fd93)
* `FEAT`: proxy mode exposes clonable view ([`73c6c44a`](https://github.com/nikku/saxen/commit/73c6c44ade3127f3819ceb825e241bb39d74fd93))

@@ -94,3 +99,3 @@ ## 5.0.1

* `CHORE`: don't return `true` on empty attrs [`f7360b11`](https://github.com/nikku/saxen/commit/f7360b115b651b9eb9ca3488a48e827d974deae1)
* `CHORE`: don't return `true` on empty attrs ([`f7360b11`](https://github.com/nikku/saxen/commit/f7360b115b651b9eb9ca3488a48e827d974deae1))

@@ -103,4 +108,4 @@ ## 4.0.1

* `FEAT`: fully support anonymous elements in namespace mode [`2f48744a`](https://github.com/nikku/saxen/commit/2f48744a077ec096a411d60f3f948903fa53bfc2)
* `FEAT`: emit `<warn>` for all attribute parse issues [`a5014b25`](https://github.com/nikku/saxen/commit/a5014b257cc4635d55daa2df9d38ce6e3b0da13d)
* `FEAT`: fully support anonymous elements in namespace mode ([`2f48744a`](https://github.com/nikku/saxen/commit/2f48744a077ec096a411d60f3f948903fa53bfc2))
* `FEAT`: emit `<warn>` for all attribute parse issues ([`a5014b25`](https://github.com/nikku/saxen/commit/a5014b257cc4635d55daa2df9d38ce6e3b0da13d))

@@ -118,6 +123,6 @@ ## 3.1.0

* `FEAT`: throw on handler errors [`4b0ebb1`](https://github.com/nikku/saxen/commit/4b0ebb12edb6f98064f33f555d519f58a8ec3a63)
* `FEAT`: throw on handler errors ([`4b0ebb1`](https://github.com/nikku/saxen/commit/4b0ebb12edb6f98064f33f555d519f58a8ec3a63))
* `FEAT`: expose current namespaces in proxy mode
* `FEAT`: normalize `xsi:type` attribute values [#4](https://github.com/nikku/saxen/issues/4)
* `FEAT`: add `warn` event, informing about recoverable errors [`7fce2151`](https://github.com/nikku/saxen/commit/7fce2151acc9bf006feab6cb3d892a004504c6ce)
* `FEAT`: normalize `xsi:type` attribute values ([#4](https://github.com/nikku/saxen/issues/4))
* `FEAT`: add `warn` event, informing about recoverable errors ([`7fce2151`](https://github.com/nikku/saxen/commit/7fce2151acc9bf006feab6cb3d892a004504c6ce))

@@ -147,3 +152,3 @@ ## 2.0.0

* `FIX`: properly handle namespace prefix collisions [#1](https://github.com/nikku/saxen/issues/1)
* `FIX`: properly handle namespace prefix collisions ([#1](https://github.com/nikku/saxen/issues/1))

@@ -150,0 +155,0 @@ ## 1.0.1

@@ -64,2 +64,4 @@ var fromCharCode = String.fromCharCode;

var NON_WHITESPACE_OUTSIDE_ROOT_NODE = 'non-whitespace outside of root node';
function error(msg) {

@@ -702,4 +704,11 @@ return new Error(msg);

column = endOfLine;
data = '';
} else {
data = xml.substring(j);
} else
// start errors
if (j === 0) {
console.log(i - startOfLine);
data = xml.substring(j, i);
}
// other errors
else {
column = i - startOfLine;

@@ -753,11 +762,30 @@ data = (j == -1 ? xml.substring(i) : xml.substring(i, j + 1));

if (j < xml.length) {
if (xml.substring(j).trim()) {
handleWarning(NON_WHITESPACE_OUTSIDE_ROOT_NODE);
}
}
return;
}
// parse text
if (j !== i) {
if (onText) {
onText(xml.substring(j, i), decodeEntities, getContext);
if (parseStop) {
return;
if (nodeStack.length) {
if (onText) {
onText(xml.substring(j, i), decodeEntities, getContext);
if (parseStop) {
return;
}
}
} else {
if (xml.substring(j, i).trim()) {
handleWarning(NON_WHITESPACE_OUTSIDE_ROOT_NODE);
if (parseStop) {
return;
}
}
}

@@ -899,3 +927,3 @@ }

if (w > 96 && w < 123 || w > 64 && w < 91 || w > 47 && w < 59 || w === 45 || w === 95) {
if (w > 96 && w < 123 || w > 64 && w < 91 || w > 47 && w < 59 || w === 45 || w === 95 || w == 46) {
continue;

@@ -902,0 +930,0 @@ }

@@ -68,2 +68,4 @@ 'use strict';

var NON_WHITESPACE_OUTSIDE_ROOT_NODE = 'non-whitespace outside of root node';
function error(msg) {

@@ -706,4 +708,11 @@ return new Error(msg);

column = endOfLine;
data = '';
} else {
data = xml.substring(j);
} else
// start errors
if (j === 0) {
console.log(i - startOfLine);
data = xml.substring(j, i);
}
// other errors
else {
column = i - startOfLine;

@@ -757,11 +766,30 @@ data = (j == -1 ? xml.substring(i) : xml.substring(i, j + 1));

if (j < xml.length) {
if (xml.substring(j).trim()) {
handleWarning(NON_WHITESPACE_OUTSIDE_ROOT_NODE);
}
}
return;
}
// parse text
if (j !== i) {
if (onText) {
onText(xml.substring(j, i), decodeEntities, getContext);
if (parseStop) {
return;
if (nodeStack.length) {
if (onText) {
onText(xml.substring(j, i), decodeEntities, getContext);
if (parseStop) {
return;
}
}
} else {
if (xml.substring(j, i).trim()) {
handleWarning(NON_WHITESPACE_OUTSIDE_ROOT_NODE);
if (parseStop) {
return;
}
}
}

@@ -903,3 +931,3 @@ }

if (w > 96 && w < 123 || w > 64 && w < 91 || w > 47 && w < 59 || w === 45 || w === 95) {
if (w > 96 && w < 123 || w > 64 && w < 91 || w > 47 && w < 59 || w === 45 || w === 95 || w == 46) {
continue;

@@ -906,0 +934,0 @@ }

@@ -70,2 +70,4 @@ (function (global, factory) {

var NON_WHITESPACE_OUTSIDE_ROOT_NODE = 'non-whitespace outside of root node';
function error(msg) {

@@ -708,4 +710,11 @@ return new Error(msg);

column = endOfLine;
data = '';
} else {
data = xml.substring(j);
} else
// start errors
if (j === 0) {
console.log(i - startOfLine);
data = xml.substring(j, i);
}
// other errors
else {
column = i - startOfLine;

@@ -759,11 +768,30 @@ data = (j == -1 ? xml.substring(i) : xml.substring(i, j + 1));

if (j < xml.length) {
if (xml.substring(j).trim()) {
handleWarning(NON_WHITESPACE_OUTSIDE_ROOT_NODE);
}
}
return;
}
// parse text
if (j !== i) {
if (onText) {
onText(xml.substring(j, i), decodeEntities, getContext);
if (parseStop) {
return;
if (nodeStack.length) {
if (onText) {
onText(xml.substring(j, i), decodeEntities, getContext);
if (parseStop) {
return;
}
}
} else {
if (xml.substring(j, i).trim()) {
handleWarning(NON_WHITESPACE_OUTSIDE_ROOT_NODE);
if (parseStop) {
return;
}
}
}

@@ -905,3 +933,3 @@ }

if (w > 96 && w < 123 || w > 64 && w < 91 || w > 47 && w < 59 || w === 45 || w === 95) {
if (w > 96 && w < 123 || w > 64 && w < 91 || w > 47 && w < 59 || w === 45 || w === 95 || w == 46) {
continue;

@@ -908,0 +936,0 @@ }

@@ -1,1 +0,1 @@

!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n(e.Saxen={})}(this,function(e){"use strict";var n=String.fromCharCode,t=Object.prototype.hasOwnProperty,r=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/gi,i={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};function s(e,r,s,u){return u?t.call(i,u)?i[u]:"&"+u+";":n(r||parseInt(s,16))}function u(e){return e.length>3&&-1!==e.indexOf("&")?e.replace(r,s):e}Object.keys(i).forEach(function(e){i[e.toUpperCase()]=i[e]});var o="http://www.w3.org/2001/XMLSchema-instance",f="xsi",a="xsi:type";function c(e){return new Error(e)}function l(e){return"missing namespace for prefix <"+e+">"}function d(e){return{get:e,enumerable:!0}}function g(e){var n,t={};for(n in e)t[n]=e[n];return t}function b(e){return e+"$uri"}function h(){return{line:0,column:0}}function m(e){throw e}e.Parser=function e(n){if(!this)return new e(n);var t,r,i,s,x,p,O,v,C,w=n&&n.proxy,A=m,y=h,k=!1,q=!1,j=null,E=!1;function M(e){e instanceof Error||(e=c(e)),j=e,A(e,y)}function N(e){x&&(e instanceof Error||(e=c(e)),x(e,y))}this.on=function(e,n){if("function"!=typeof n)throw c("required args <name, cb>");switch(e){case"openTag":r=n;break;case"text":t=n;break;case"closeTag":i=n;break;case"error":A=n;break;case"warn":x=n;break;case"cdata":s=n;break;case"attention":v=n;break;case"question":O=n;break;case"comment":p=n;break;default:throw c("unsupported event: "+e)}return this},this.ns=function(e){if(void 0===e&&(e={}),"object"!=typeof e)throw c("required args <nsMap={}>");var n,t={};for(n in e)t[n]=e[n];return t[o]=f,q=!0,C=t,this},this.parse=function(e){if("string"!=typeof e)throw c("required args <xml=string>");return j=null,function(e){var n,o,f,c,h,m,x,A,j,P,S=q?[]:null,T=q?function(e){var n,t,r={};for(n in e)r[t=e[n]]=t,r[b(t)]=n;return r}(C):null,_=[],D=0,I=!1,L=!1,U=0,X=0,$="",z=0;function B(){if(null!==P)return P;var e,n,t,r,i,s,o,f,c,d,h,m=q&&T.xmlns,x=q&&k?[]:null,p=z,O=$,v=O.length,w={},A={};e:for(;p<v;p++)if(c=!1,!(32===(d=O.charCodeAt(p))||d<14&&d>8)){for((d<65||d>122||d>90&&d<97)&&95!==d&&58!==d&&(N("illegal first char attribute name"),c=!0),h=p+1;h<v;h++)if(!((d=O.charCodeAt(h))>96&&d<123||d>64&&d<91||d>47&&d<59||46===d||45===d||95===d)){if(32===d||d<14&&d>8){N("missing attribute value"),p=h;continue e}if(61===d)break;N("illegal attribute name char"),c=!0}if("xmlns:xmlns"===(f=O.substring(p,h))&&(N("illegal declaration of xmlns"),c=!0),34===(d=O.charCodeAt(h+1)))-1===(h=O.indexOf('"',p=h+2))&&-1!==(h=O.indexOf("'",p))&&(N("attribute value quote missmatch"),c=!0);else if(39===d)-1===(h=O.indexOf("'",p=h+2))&&-1!==(h=O.indexOf('"',p))&&(N("attribute value quote missmatch"),c=!0);else for(N("missing attribute value quotes"),c=!0,h+=1;h<v&&!(32===(d=O.charCodeAt(h+1))||d<14&&d>8);h++);for(-1===h&&(N("missing closing quotes"),h=v,c=!0),c||(s=O.substring(p,h)),p=h;h+1<v&&!(32===(d=O.charCodeAt(h+1))||d<14&&d>8);h++)p===h&&(N("illegal character after attribute end"),c=!0);if(p=h+1,!c)if(f in A)N("attribute <"+f+"> already defined");else if(A[f]=!0,q)if(k){if(null!==(i="xmlns"===f?"xmlns":120===f.charCodeAt(0)&&"xmlns:"===f.substr(0,6)?f.substr(6):null)){if(e=u(s),n=b(i),!(o=C[e])){if("xmlns"===i||n in T&&T[n]!==e)do{o="ns"+D++}while(void 0!==T[o]);else o=i;C[e]=o}T[i]!==o&&(r||(T=g(T),r=!0),T[i]=o,"xmlns"===i&&(T[b(o)]=e,m=o),T[n]=e),w[f]=s;continue}x.push(f,s)}else-1!==(d=f.indexOf(":"))?(t=T[f.substring(0,d)])?((f=m===t?f.substr(d+1):t+f.substr(d))===a&&(-1!==(d=s.indexOf(":"))?(t=s.substring(0,d),t=T[t]||t,s=t+s.substring(d)):s=m+":"+s),w[f]=s):N(l(f.substring(0,d))):w[f]=s;else w[f]=s}if(k)for(p=0,v=x.length;p<v;p++){if(f=x[p++],s=x[p],-1!==(d=f.indexOf(":"))){if(!(t=T[f.substring(0,d)])){N(l(f.substring(0,d)));continue}(f=m===t?f.substr(d+1):t+f.substr(d))===a&&(-1!==(d=s.indexOf(":"))?(t=s.substring(0,d),t=T[t]||t,s=t+s.substring(d)):s=m+":"+s)}w[f]=s}return P=w}for(y=function(){for(var n,t,r=/(\r\n|\r|\n)/g,i=0,s=0,u=0,o=X;U>=u&&(n=r.exec(e))&&!((o=n[0].length+n.index)>U);)i+=1,u=o;return-1==U?(s=o,t=""):(s=U-u,t=-1==X?e.substring(U):e.substring(U,X+1)),{data:t,line:i,column:s}},w&&(j=Object.create({},{name:d(function(){return x}),originalName:d(function(){return A}),attrs:d(B),ns:d(function(){return T})}));-1!==X;){if(-1===(U=60===e.charCodeAt(X)?X:e.indexOf("<",X)))return _.length?M("unexpected end of file"):0===X?M("missing start tag"):void 0;if(X!==U&&t&&(t(e.substring(X,U),u,y),E))return;if(33!==(h=e.charCodeAt(U+1)))if(63!==h){if(-1==(X=e.indexOf(">",U+1)))return M("unclosed tag");if(P={},47===h){if(I=!1,L=!0,!_.length)return M("missing open tag");if(o=x=_.pop(),c=U+2+o.length,e.substring(U+2,c)!==o)return M("closing tag mismatch");for(;c<X;c++)if(!(32===(h=e.charCodeAt(c))||h>8&&h<14))return M("close tag")}else{if(47===e.charCodeAt(X-1)?(o=x=e.substring(U+1,X-1),I=!0,L=!0):(o=x=e.substring(U+1,X),I=!0,L=!1),!(h>96&&h<123||h>64&&h<91||95===h||58===h))return M("illegal first char nodeName");for(c=1,f=o.length;c<f;c++)if(!((h=o.charCodeAt(c))>96&&h<123||h>64&&h<91||h>47&&h<59||45===h||95===h)){if(32===h||h<14&&h>8){x=o.substring(0,c),P=null;break}return M("invalid nodeName")}L||_.push(x)}if(q){if(n=T,I&&(L||S.push(n),null===P&&(k=-1!==o.indexOf("xmlns",c))&&(z=c,$=o,B(),k=!1)),A=x,-1!==(h=x.indexOf(":"))){if(!(m=T[x.substring(0,h)]))return M("missing namespace on <"+A+">");x=x.substr(h+1)}else m=T.xmlns;m&&(x=m+":"+x)}if(I&&(z=c,$=o,r&&(w?r(j,u,L,y):r(x,B,u,L,y),E)))return;if(L){if(i&&(i(w?j:x,u,I,y),E))return;q&&(T=I?n:S.pop())}X+=1}else{if(-1===(X=e.indexOf("?>",U)))return M("unclosed question");if(O&&(O(e.substring(U,X+2),y),E))return;X+=2}else{if(91===(h=e.charCodeAt(U+2))&&"CDATA["===e.substr(U+3,6)){if(-1===(X=e.indexOf("]]>",U)))return M("unclosed cdata");if(s&&(s(e.substring(U+9,X),y),E))return;X+=3;continue}if(45===h&&45===e.charCodeAt(U+3)){if(-1===(X=e.indexOf("--\x3e",U)))return M("unclosed comment");if(p&&(p(e.substring(U+4,X),u,y),E))return;X+=3;continue}if(-1===(X=e.indexOf(">",U+1)))return M("unclosed tag");if(v&&(v(e.substring(U,X+1),u,y),E))return;X+=1}}}(e),y=h,E=!1,j},this.stop=function(){E=!0}},e.decode=u,Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n(e.Saxen={})}(this,function(e){"use strict";var n=String.fromCharCode,t=Object.prototype.hasOwnProperty,r=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/gi,i={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};function s(e,r,s,u){return u?t.call(i,u)?i[u]:"&"+u+";":n(r||parseInt(s,16))}function u(e){return e.length>3&&-1!==e.indexOf("&")?e.replace(r,s):e}Object.keys(i).forEach(function(e){i[e.toUpperCase()]=i[e]});var o="http://www.w3.org/2001/XMLSchema-instance",f="xsi",a="xsi:type",c="non-whitespace outside of root node";function l(e){return new Error(e)}function d(e){return"missing namespace for prefix <"+e+">"}function g(e){return{get:e,enumerable:!0}}function b(e){var n,t={};for(n in e)t[n]=e[n];return t}function h(e){return e+"$uri"}function m(){return{line:0,column:0}}function x(e){throw e}e.Parser=function e(n){if(!this)return new e(n);var t,r,i,s,p,O,v,w,C,A=n&&n.proxy,y=x,k=m,q=!1,j=!1,E=null,M=!1;function N(e){e instanceof Error||(e=l(e)),E=e,y(e,k)}function P(e){p&&(e instanceof Error||(e=l(e)),p(e,k))}this.on=function(e,n){if("function"!=typeof n)throw l("required args <name, cb>");switch(e){case"openTag":r=n;break;case"text":t=n;break;case"closeTag":i=n;break;case"error":y=n;break;case"warn":p=n;break;case"cdata":s=n;break;case"attention":w=n;break;case"question":v=n;break;case"comment":O=n;break;default:throw l("unsupported event: "+e)}return this},this.ns=function(e){if(void 0===e&&(e={}),"object"!=typeof e)throw l("required args <nsMap={}>");var n,t={};for(n in e)t[n]=e[n];return t[o]=f,j=!0,C=t,this},this.parse=function(e){if("string"!=typeof e)throw l("required args <xml=string>");return E=null,function(e){var n,o,f,l,m,x,p,y,E,S,T=j?[]:null,_=j?function(e){var n,t,r={};for(n in e)r[t=e[n]]=t,r[h(t)]=n;return r}(C):null,D=[],I=0,L=!1,U=!1,X=0,$=0,z="",B=0;function F(){if(null!==S)return S;var e,n,t,r,i,s,o,f,c,l,g,m=j&&_.xmlns,x=j&&q?[]:null,p=B,O=z,v=O.length,w={},A={};e:for(;p<v;p++)if(c=!1,!(32===(l=O.charCodeAt(p))||l<14&&l>8)){for((l<65||l>122||l>90&&l<97)&&95!==l&&58!==l&&(P("illegal first char attribute name"),c=!0),g=p+1;g<v;g++)if(!((l=O.charCodeAt(g))>96&&l<123||l>64&&l<91||l>47&&l<59||46===l||45===l||95===l)){if(32===l||l<14&&l>8){P("missing attribute value"),p=g;continue e}if(61===l)break;P("illegal attribute name char"),c=!0}if("xmlns:xmlns"===(f=O.substring(p,g))&&(P("illegal declaration of xmlns"),c=!0),34===(l=O.charCodeAt(g+1)))-1===(g=O.indexOf('"',p=g+2))&&-1!==(g=O.indexOf("'",p))&&(P("attribute value quote missmatch"),c=!0);else if(39===l)-1===(g=O.indexOf("'",p=g+2))&&-1!==(g=O.indexOf('"',p))&&(P("attribute value quote missmatch"),c=!0);else for(P("missing attribute value quotes"),c=!0,g+=1;g<v&&!(32===(l=O.charCodeAt(g+1))||l<14&&l>8);g++);for(-1===g&&(P("missing closing quotes"),g=v,c=!0),c||(s=O.substring(p,g)),p=g;g+1<v&&!(32===(l=O.charCodeAt(g+1))||l<14&&l>8);g++)p===g&&(P("illegal character after attribute end"),c=!0);if(p=g+1,!c)if(f in A)P("attribute <"+f+"> already defined");else if(A[f]=!0,j)if(q){if(null!==(i="xmlns"===f?"xmlns":120===f.charCodeAt(0)&&"xmlns:"===f.substr(0,6)?f.substr(6):null)){if(e=u(s),n=h(i),!(o=C[e])){if("xmlns"===i||n in _&&_[n]!==e)do{o="ns"+I++}while(void 0!==_[o]);else o=i;C[e]=o}_[i]!==o&&(r||(_=b(_),r=!0),_[i]=o,"xmlns"===i&&(_[h(o)]=e,m=o),_[n]=e),w[f]=s;continue}x.push(f,s)}else-1!==(l=f.indexOf(":"))?(t=_[f.substring(0,l)])?((f=m===t?f.substr(l+1):t+f.substr(l))===a&&(-1!==(l=s.indexOf(":"))?(t=s.substring(0,l),t=_[t]||t,s=t+s.substring(l)):s=m+":"+s),w[f]=s):P(d(f.substring(0,l))):w[f]=s;else w[f]=s}if(q)for(p=0,v=x.length;p<v;p++){if(f=x[p++],s=x[p],-1!==(l=f.indexOf(":"))){if(!(t=_[f.substring(0,l)])){P(d(f.substring(0,l)));continue}(f=m===t?f.substr(l+1):t+f.substr(l))===a&&(-1!==(l=s.indexOf(":"))?(t=s.substring(0,l),t=_[t]||t,s=t+s.substring(l)):s=m+":"+s)}w[f]=s}return S=w}for(k=function(){for(var n,t,r=/(\r\n|\r|\n)/g,i=0,s=0,u=0,o=$;X>=u&&(n=r.exec(e))&&!((o=n[0].length+n.index)>X);)i+=1,u=o;return-1==X?(s=o,t=e.substring($)):0===$?(console.log(X-u),t=e.substring($,X)):(s=X-u,t=-1==$?e.substring(X):e.substring(X,$+1)),{data:t,line:i,column:s}},A&&(E=Object.create({},{name:g(function(){return p}),originalName:g(function(){return y}),attrs:g(F),ns:g(function(){return _})}));-1!==$;){if(-1===(X=60===e.charCodeAt($)?$:e.indexOf("<",$)))return D.length?N("unexpected end of file"):0===$?N("missing start tag"):void($<e.length&&e.substring($).trim()&&P(c));if($!==X)if(D.length){if(t&&(t(e.substring($,X),u,k),M))return}else if(e.substring($,X).trim()&&(P(c),M))return;if(33!==(m=e.charCodeAt(X+1)))if(63!==m){if(-1==($=e.indexOf(">",X+1)))return N("unclosed tag");if(S={},47===m){if(L=!1,U=!0,!D.length)return N("missing open tag");if(o=p=D.pop(),l=X+2+o.length,e.substring(X+2,l)!==o)return N("closing tag mismatch");for(;l<$;l++)if(!(32===(m=e.charCodeAt(l))||m>8&&m<14))return N("close tag")}else{if(47===e.charCodeAt($-1)?(o=p=e.substring(X+1,$-1),L=!0,U=!0):(o=p=e.substring(X+1,$),L=!0,U=!1),!(m>96&&m<123||m>64&&m<91||95===m||58===m))return N("illegal first char nodeName");for(l=1,f=o.length;l<f;l++)if(!((m=o.charCodeAt(l))>96&&m<123||m>64&&m<91||m>47&&m<59||45===m||95===m||46==m)){if(32===m||m<14&&m>8){p=o.substring(0,l),S=null;break}return N("invalid nodeName")}U||D.push(p)}if(j){if(n=_,L&&(U||T.push(n),null===S&&(q=-1!==o.indexOf("xmlns",l))&&(B=l,z=o,F(),q=!1)),y=p,-1!==(m=p.indexOf(":"))){if(!(x=_[p.substring(0,m)]))return N("missing namespace on <"+y+">");p=p.substr(m+1)}else x=_.xmlns;x&&(p=x+":"+p)}if(L&&(B=l,z=o,r&&(A?r(E,u,U,k):r(p,F,u,U,k),M)))return;if(U){if(i&&(i(A?E:p,u,L,k),M))return;j&&(_=L?n:T.pop())}$+=1}else{if(-1===($=e.indexOf("?>",X)))return N("unclosed question");if(v&&(v(e.substring(X,$+2),k),M))return;$+=2}else{if(91===(m=e.charCodeAt(X+2))&&"CDATA["===e.substr(X+3,6)){if(-1===($=e.indexOf("]]>",X)))return N("unclosed cdata");if(s&&(s(e.substring(X+9,$),k),M))return;$+=3;continue}if(45===m&&45===e.charCodeAt(X+3)){if(-1===($=e.indexOf("--\x3e",X)))return N("unclosed comment");if(O&&(O(e.substring(X+4,$),u,k),M))return;$+=3;continue}if(-1===($=e.indexOf(">",X+1)))return N("unclosed tag");if(w&&(w(e.substring(X,$+1),u,k),M))return;$+=1}}}(e),k=m,M=!1,E},this.stop=function(){M=!0}},e.decode=u,Object.defineProperty(e,"__esModule",{value:!0})});

@@ -18,3 +18,3 @@ {

],
"version": "8.0.0",
"version": "8.1.0",
"main": "./dist/index.js",

@@ -21,0 +21,0 @@ "module": "./dist/index.esm.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc