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 7.0.0 to 7.0.1

4

CHANGELOG.md

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

## 7.0.1
* `FIX`: allow `.` in attribute name part
## 7.0.0

@@ -11,0 +15,0 @@

@@ -393,3 +393,10 @@ 'use strict';

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 === 46 || // '.'
w === 45 || // '-'
w === 95 // '_'
) {
continue;

@@ -396,0 +403,0 @@ }

@@ -395,3 +395,10 @@ (function (global, factory) {

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 === 46 || // '.'
w === 45 || // '-'
w === 95 // '_'
) {
continue;

@@ -398,0 +405,0 @@ }

2

dist/saxen.umd.min.js

@@ -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||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";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})});

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

],
"version": "7.0.0",
"version": "7.0.1",
"main": "./dist/index.js",

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

Sorry, the diff of this file is not supported yet

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