xml-tokenizer 0.0.10 → 0.0.12

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.
@@ -1 +1 @@
1
- "use strict";var h=require("../get-q-name.js"),l=Object.defineProperty,o=(e,t,s)=>t in e?l(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,r=(e,t,s)=>o(e,typeof t!="symbol"?t+"":t,s);class c{constructor(t){r(this,"_segment"),r(this,"_matchCriteria",0),r(this,"_toCacheNodeProps",0),r(this,"_enteredDepth",null),this._segment=t,this.applyLevels()}get matchCriteria(){return this._matchCriteria}get toCacheNodeProps(){return this._toCacheNodeProps}get enteredDepth(){return this._enteredDepth}applyLevels(){let t=0,s=0;(this._segment.local!=null||this._segment.prefix!=null)&&(t|=1),this._segment.attributes!=null&&(t|=2,s|=2),this._segment.containsText!=null&&(t|=4),this._segment.predicate!=null&&(t|=8,s|=7),this._matchCriteria=t,this._toCacheNodeProps=s}matchesName(t,s){return(this._segment.local==null||this._segment.local==="*"||this._segment.local===t)&&(this._segment.prefix==null||this._segment.prefix===s)}matchesAttributes(t){if(this._segment.attributes!=null)for(const s of this._segment.attributes){const i=h.getQName(s.local,s.prefix);if(!(i in t)||s.value!=null&&t[i]!==s.value)return!1}return!0}matchesText(t){return this._segment.containsText==null||t.includes(this._segment.containsText)}matchesDepth(t,s){switch(this._segment.axis){case"child":return t===s+1;case"self-or-descendant":return t>=s}}match(t){this._enteredDepth=t}unmatch(){this._enteredDepth=null}}var a=(e=>(e[e.None=0]="None",e[e.Name=1]="Name",e[e.Attributes=2]="Attributes",e[e.Text=4]="Text",e))(a||{}),n=(e=>(e[e.None=0]="None",e[e.Name=1]="Name",e[e.Attributes=2]="Attributes",e[e.Text=4]="Text",e[e.Node=8]="Node",e))(n||{});exports.EToCacheNodeProps=a,exports.ETokenMatchCriteria=n,exports.TokenSelectState=c;
1
+ "use strict";var s=require("./match-string.js"),m=Object.defineProperty,g=(t,e,r)=>e in t?m(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,a=(t,e,r)=>g(t,typeof e!="symbol"?e+"":e,r);class p{constructor(e){a(this,"_segment"),a(this,"_matchCriteria",0),a(this,"_toCacheNodeProps",0),a(this,"_enteredDepth",null),this._segment=e,this.applyLevels()}get matchCriteria(){return this._matchCriteria}get toCacheNodeProps(){return this._toCacheNodeProps}get enteredDepth(){return this._enteredDepth}applyLevels(){let e=0,r=0;(this._segment.local!=null||this._segment.prefix!=null)&&(e|=1),this._segment.attributes!=null&&(e|=2,r|=2),this._segment.text!=null&&(e|=4),this._matchCriteria=e,this._toCacheNodeProps=r}matchesName(e,r){return(this._segment.local==null||s.matchString(e,this._segment.local))&&(this._segment.prefix==null||s.matchString(r,this._segment.prefix))}matchesAttributes(e){if(this._segment.attributes==null)return!0;for(const r of this._segment.attributes){let n=!1;for(const i of e){const o=r.local==null||s.matchString(i.local,r.local),c=r.value==null||i.value!=null&&s.matchString(i.value,r.value),u=r.prefix==null||i.prefix!=null&&s.matchString(i.prefix,r.prefix);if(o&&c&&u){n=!0;break}}if(!n)return!1}return!0}matchesText(e){return this._segment.text==null||s.matchString(e,this._segment.text)}matchesDepth(e,r){switch(this._segment.axis){case"child":return e===r+1;case"self-or-descendant":return e>=r}}match(e){this._enteredDepth=e}unmatch(){this._enteredDepth=null}}var h=(t=>(t[t.None=0]="None",t[t.Name=1]="Name",t[t.Attributes=2]="Attributes",t[t.Text=4]="Text",t))(h||{}),l=(t=>(t[t.None=0]="None",t[t.Name=1]="Name",t[t.Attributes=2]="Attributes",t[t.Text=4]="Text",t[t.Node=8]="Node",t))(l||{});exports.EToCacheNodeProps=h,exports.ETokenMatchCriteria=l,exports.TokenSelectState=p;
@@ -1 +1 @@
1
- "use strict";var d=require("../get-q-name.js"),n=require("./TokenSelectState.js"),_=Object.defineProperty,S=(i,t,e)=>t in i?_(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e,c=(i,t,e)=>S(i,typeof t!="symbol"?t+"":t,e);class p{constructor(t){c(this,"_states"),c(this,"_currentState",null),c(this,"_cachedNodeProps",{prefix:null,local:null,attributes:null,text:null}),c(this,"_cachedTokens",[]),c(this,"_toRecordTokens",[]),this._states=t.map(e=>new n.TokenSelectState(e))}getNextState(){var t;const e=this._currentState!=null?this._currentState+1:0;return e<this._states.length&&(t=this._states[e])!=null?t:null}getCurrentState(){var t;return this._currentState!=null&&this._currentState<this._states.length&&(t=this._states[this._currentState])!=null?t:null}record(t){this.getOffsetToFinal()<=1&&this._cachedTokens.push(t)}takeRecordedTokens(){if(this._toRecordTokens.length>0){const t=this._toRecordTokens;return this._toRecordTokens=[],t}return null}transitionIfNameMatch(t,e,r){var s;const a=this.getNextState(),h=this.getCurrentState();return a==null?!1:(a.toCacheNodeProps&n.EToCacheNodeProps.Name&&(this._cachedNodeProps.local=t,this._cachedNodeProps.prefix=e),a.matchesName(t,e)&&a.matchesDepth(r,(s=h==null?void 0:h.enteredDepth)!=null?s:0)&&!(a.matchCriteria&(n.ETokenMatchCriteria.Attributes|n.ETokenMatchCriteria.Text|n.ETokenMatchCriteria.Node))?(this.transitionForward(r),!0):!1)}transitionIfAttributesMatch(t,e,r,s){var a,h;const o=this.getNextState(),u=this.getCurrentState();if(o==null)return!1;const l=(a=this._cachedNodeProps.attributes)!=null?a:{};return l[d.getQName(t,e)]=r,o.toCacheNodeProps&n.EToCacheNodeProps.Attributes&&(this._cachedNodeProps.attributes=l),o.matchesAttributes(l)&&o.matchesDepth(s,(h=u==null?void 0:u.enteredDepth)!=null?h:0)&&!(o.matchCriteria&(n.ETokenMatchCriteria.Text|n.ETokenMatchCriteria.Node))?(this.transitionForward(s),!0):!1}transitionIfTextMatch(t,e){var r;const s=this.getNextState(),a=this.getCurrentState();return s==null?!1:(s.toCacheNodeProps&n.EToCacheNodeProps.Text&&(this._cachedNodeProps.text=t),s.matchesText(t)&&s.matchesDepth(e,(r=a==null?void 0:a.enteredDepth)!=null?r:0)&&!(s.matchCriteria&n.ETokenMatchCriteria.Node)?(this.transitionForward(e),!0):!1)}transitionForward(t){const e=this.getCurrentState();e!=null&&e.unmatch(),this._currentState=this._currentState!=null?this._currentState+1:0;const r=this.getCurrentState();r!=null&&r.match(t),this.isFinalState()&&(this._toRecordTokens=this._cachedTokens),this.resetCurrentStateCache()}transitionBack(t){const e=this.getCurrentState();e!=null&&e.unmatch(),this._currentState=this._currentState!=null?this._currentState-1:0;const r=this.getCurrentState();r!=null&&r.match(t),this.resetCurrentStateCache()}isFinalState(){return this._currentState!=null&&this._currentState>=this._states.length-1}getOffsetToFinal(){return this._currentState==null?this._states.length:this._states.length-1-this._currentState}resetCurrentStateCache(){this._cachedNodeProps.prefix=null,this._cachedNodeProps.local=null,this._cachedNodeProps.attributes=null,this._cachedNodeProps.text=null,this._cachedTokens=[]}}exports.TokenSelectStateMachine=p;
1
+ "use strict";var n=require("./TokenSelectState.js"),d=Object.defineProperty,_=(i,t,e)=>t in i?d(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e,c=(i,t,e)=>_(i,typeof t!="symbol"?t+"":t,e);class S{constructor(t){c(this,"_states"),c(this,"_currentState",null),c(this,"_cachedNodeProps",{prefix:null,local:null,attributes:null,text:null}),c(this,"_cachedTokens",[]),c(this,"_toRecordTokens",[]),this._states=t.map(e=>new n.TokenSelectState(e))}getNextState(){var t;const e=this._currentState!=null?this._currentState+1:0;return e<this._states.length&&(t=this._states[e])!=null?t:null}getCurrentState(){var t;return this._currentState!=null&&this._currentState<this._states.length&&(t=this._states[this._currentState])!=null?t:null}record(t){this.getOffsetToFinal()<=1&&this._cachedTokens.push(t)}takeRecordedTokens(){if(this._toRecordTokens.length>0){const t=this._toRecordTokens;return this._toRecordTokens=[],t}return null}transitionIfNameMatch(t,e,r){var s;const a=this.getNextState(),h=this.getCurrentState();return a==null?!1:(a.toCacheNodeProps&n.EToCacheNodeProps.Name&&(this._cachedNodeProps.local=t,this._cachedNodeProps.prefix=e),a.matchesName(t,e)&&a.matchesDepth(r,(s=h==null?void 0:h.enteredDepth)!=null?s:0)&&!(a.matchCriteria&(n.ETokenMatchCriteria.Attributes|n.ETokenMatchCriteria.Text|n.ETokenMatchCriteria.Node))?(this.transitionForward(r),!0):!1)}transitionIfAttributesMatch(t,e,r,s){var a,h;const o=this.getNextState(),u=this.getCurrentState();if(o==null)return!1;const l=(a=this._cachedNodeProps.attributes)!=null?a:[];return l.push({local:t,prefix:e,value:r}),o.toCacheNodeProps&n.EToCacheNodeProps.Attributes&&(this._cachedNodeProps.attributes=l),o.matchesAttributes(l)&&o.matchesDepth(s,(h=u==null?void 0:u.enteredDepth)!=null?h:0)&&!(o.matchCriteria&(n.ETokenMatchCriteria.Text|n.ETokenMatchCriteria.Node))?(this.transitionForward(s),!0):!1}transitionIfTextMatch(t,e){var r;const s=this.getNextState(),a=this.getCurrentState();return s==null?!1:(s.toCacheNodeProps&n.EToCacheNodeProps.Text&&(this._cachedNodeProps.text=t),s.matchesText(t)&&s.matchesDepth(e,(r=a==null?void 0:a.enteredDepth)!=null?r:0)&&!(s.matchCriteria&n.ETokenMatchCriteria.Node)?(this.transitionForward(e),!0):!1)}transitionForward(t){const e=this.getCurrentState();e!=null&&e.unmatch(),this._currentState=this._currentState!=null?this._currentState+1:0;const r=this.getCurrentState();r!=null&&r.match(t),this.isFinalState()&&(this._toRecordTokens=this._cachedTokens),this.resetCurrentStateCache()}transitionBack(t){const e=this.getCurrentState();e!=null&&e.unmatch(),this._currentState=this._currentState!=null?this._currentState-1:0;const r=this.getCurrentState();r!=null&&r.match(t),this.resetCurrentStateCache()}isFinalState(){return this._currentState!=null&&this._currentState>=this._states.length-1}getOffsetToFinal(){return this._currentState==null?this._states.length:this._states.length-1-this._currentState}resetCurrentStateCache(){this._cachedNodeProps.prefix=null,this._cachedNodeProps.local=null,this._cachedNodeProps.attributes=null,this._cachedNodeProps.text=null,this._cachedTokens=[]}}exports.TokenSelectStateMachine=S;
@@ -0,0 +1 @@
1
+ "use strict";function a(t,e){if(typeof e=="string")return t===e;switch(e.matchStrategy){case"ANY":return!0;case"EXACT":return t===e.value;case"CONTAINS":return t.includes(e.value);case"STARTS_WITH":return t.startsWith(e.value);case"ENDS_WITH":return t.endsWith(e.value)}}exports.matchString=a;
@@ -1 +1 @@
1
- "use strict";var o=require("./get-q-name.js"),a=require("./tokenizer/tokenize.js");function s(i,l=!1){const e={},t=[e];return a.tokenize(i,l,c=>{r(c,t)}),e}function r(i,l){switch(i.type){case"ElementStart":{const e=o.getQName(i.local,i.prefix),t=`_${e}`,c={},n=l[l.length-1];n!=null&&(n.content!=null?(c.tag=e,n.content.push(c)):n.text!=null?(c.tag=e,n.content=[n.text,c],delete n.text):n[t]==null?n[t]=c:Array.isArray(n[t])?n[t].push(c):n[t]=[n[t],c]),l.push(c);break}case"ElementEnd":{(i.end.type==="Close"||i.end.type==="Empty")&&l.pop();break}case"Attribute":{const e=l[l.length-1];if(e!=null){const t=o.getQName(i.local,i.prefix);e.attributes!=null?e.attributes[t]=i.value:e.attributes={[t]:i.value}}break}case"Text":case"Cdata":{const e=l[l.length-1];if(e!=null){const t=i.text.trim();t.length>0&&(e.content!=null?e.content.push(t):e.text!=null?(e.content=[e.text,t],delete e.text):e.text=t)}break}}}exports.processTokenForSimplifiedObject=r,exports.xmlToSimplifiedObject=s;
1
+ "use strict";var c=require("./get-q-name.js"),o=require("./tokenizer/tokenize.js");function s(i,l=!1){const e={},t=[e];return o.tokenize(i,l,r=>{a(r,t)}),e}function a(i,l){switch(i.type){case"ElementStart":{const e=c.getQName(i.local,i.prefix),t=`_${e}`,r={},n=l[l.length-1];n!=null&&(n.content!=null?(r.tag=e,n.content.push(r)):n.text!=null?(r.tag=e,n.content=[n.text,r],delete n.text):n[t]==null?n[t]=[r]:Array.isArray(n[t])?n[t].push(r):n[t]=[n[t],r]),l.push(r);break}case"ElementEnd":{(i.end.type==="Close"||i.end.type==="Empty")&&l.pop();break}case"Attribute":{const e=l[l.length-1];if(e!=null){const t=c.getQName(i.local,i.prefix);e.attributes!=null?e.attributes[t]=i.value:e.attributes={[t]:i.value}}break}case"Text":case"Cdata":{const e=l[l.length-1];if(e!=null){const t=i.text.trim();t.length>0&&(e.content!=null?e.content.push(t):e.text!=null?(e.content=[e.text,t],delete e.text):e.text=t)}break}}}exports.processTokenForSimplifiedObject=a,exports.xmlToSimplifiedObject=s;
@@ -1 +1 @@
1
- import{getQName as h}from"../get-q-name.js";var l=Object.defineProperty,o=(e,t,s)=>t in e?l(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,r=(e,t,s)=>o(e,typeof t!="symbol"?t+"":t,s);class c{constructor(t){r(this,"_segment"),r(this,"_matchCriteria",0),r(this,"_toCacheNodeProps",0),r(this,"_enteredDepth",null),this._segment=t,this.applyLevels()}get matchCriteria(){return this._matchCriteria}get toCacheNodeProps(){return this._toCacheNodeProps}get enteredDepth(){return this._enteredDepth}applyLevels(){let t=0,s=0;(this._segment.local!=null||this._segment.prefix!=null)&&(t|=1),this._segment.attributes!=null&&(t|=2,s|=2),this._segment.containsText!=null&&(t|=4),this._segment.predicate!=null&&(t|=8,s|=7),this._matchCriteria=t,this._toCacheNodeProps=s}matchesName(t,s){return(this._segment.local==null||this._segment.local==="*"||this._segment.local===t)&&(this._segment.prefix==null||this._segment.prefix===s)}matchesAttributes(t){if(this._segment.attributes!=null)for(const s of this._segment.attributes){const i=h(s.local,s.prefix);if(!(i in t)||s.value!=null&&t[i]!==s.value)return!1}return!0}matchesText(t){return this._segment.containsText==null||t.includes(this._segment.containsText)}matchesDepth(t,s){switch(this._segment.axis){case"child":return t===s+1;case"self-or-descendant":return t>=s}}match(t){this._enteredDepth=t}unmatch(){this._enteredDepth=null}}var a=(e=>(e[e.None=0]="None",e[e.Name=1]="Name",e[e.Attributes=2]="Attributes",e[e.Text=4]="Text",e))(a||{}),n=(e=>(e[e.None=0]="None",e[e.Name=1]="Name",e[e.Attributes=2]="Attributes",e[e.Text=4]="Text",e[e.Node=8]="Node",e))(n||{});export{a as EToCacheNodeProps,n as ETokenMatchCriteria,c as TokenSelectState};
1
+ import{matchString as r}from"./match-string.js";var m=Object.defineProperty,p=(e,t,s)=>t in e?m(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,a=(e,t,s)=>p(e,typeof t!="symbol"?t+"":t,s);class _{constructor(t){a(this,"_segment"),a(this,"_matchCriteria",0),a(this,"_toCacheNodeProps",0),a(this,"_enteredDepth",null),this._segment=t,this.applyLevels()}get matchCriteria(){return this._matchCriteria}get toCacheNodeProps(){return this._toCacheNodeProps}get enteredDepth(){return this._enteredDepth}applyLevels(){let t=0,s=0;(this._segment.local!=null||this._segment.prefix!=null)&&(t|=1),this._segment.attributes!=null&&(t|=2,s|=2),this._segment.text!=null&&(t|=4),this._matchCriteria=t,this._toCacheNodeProps=s}matchesName(t,s){return(this._segment.local==null||r(t,this._segment.local))&&(this._segment.prefix==null||r(s,this._segment.prefix))}matchesAttributes(t){if(this._segment.attributes==null)return!0;for(const s of this._segment.attributes){let n=!1;for(const i of t){const o=s.local==null||r(i.local,s.local),u=s.value==null||i.value!=null&&r(i.value,s.value),c=s.prefix==null||i.prefix!=null&&r(i.prefix,s.prefix);if(o&&u&&c){n=!0;break}}if(!n)return!1}return!0}matchesText(t){return this._segment.text==null||r(t,this._segment.text)}matchesDepth(t,s){switch(this._segment.axis){case"child":return t===s+1;case"self-or-descendant":return t>=s}}match(t){this._enteredDepth=t}unmatch(){this._enteredDepth=null}}var h=(e=>(e[e.None=0]="None",e[e.Name=1]="Name",e[e.Attributes=2]="Attributes",e[e.Text=4]="Text",e))(h||{}),l=(e=>(e[e.None=0]="None",e[e.Name=1]="Name",e[e.Attributes=2]="Attributes",e[e.Text=4]="Text",e[e.Node=8]="Node",e))(l||{});export{h as EToCacheNodeProps,l as ETokenMatchCriteria,_ as TokenSelectState};
@@ -1 +1 @@
1
- import{getQName as _}from"../get-q-name.js";import{TokenSelectState as S,EToCacheNodeProps as u,ETokenMatchCriteria as h}from"./TokenSelectState.js";var p=Object.defineProperty,N=(a,t,e)=>t in a?p(a,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[t]=e,c=(a,t,e)=>N(a,typeof t!="symbol"?t+"":t,e);class m{constructor(t){c(this,"_states"),c(this,"_currentState",null),c(this,"_cachedNodeProps",{prefix:null,local:null,attributes:null,text:null}),c(this,"_cachedTokens",[]),c(this,"_toRecordTokens",[]),this._states=t.map(e=>new S(e))}getNextState(){var t;const e=this._currentState!=null?this._currentState+1:0;return e<this._states.length&&(t=this._states[e])!=null?t:null}getCurrentState(){var t;return this._currentState!=null&&this._currentState<this._states.length&&(t=this._states[this._currentState])!=null?t:null}record(t){this.getOffsetToFinal()<=1&&this._cachedTokens.push(t)}takeRecordedTokens(){if(this._toRecordTokens.length>0){const t=this._toRecordTokens;return this._toRecordTokens=[],t}return null}transitionIfNameMatch(t,e,r){var s;const n=this.getNextState(),i=this.getCurrentState();return n==null?!1:(n.toCacheNodeProps&u.Name&&(this._cachedNodeProps.local=t,this._cachedNodeProps.prefix=e),n.matchesName(t,e)&&n.matchesDepth(r,(s=i==null?void 0:i.enteredDepth)!=null?s:0)&&!(n.matchCriteria&(h.Attributes|h.Text|h.Node))?(this.transitionForward(r),!0):!1)}transitionIfAttributesMatch(t,e,r,s){var n,i;const o=this.getNextState(),d=this.getCurrentState();if(o==null)return!1;const l=(n=this._cachedNodeProps.attributes)!=null?n:{};return l[_(t,e)]=r,o.toCacheNodeProps&u.Attributes&&(this._cachedNodeProps.attributes=l),o.matchesAttributes(l)&&o.matchesDepth(s,(i=d==null?void 0:d.enteredDepth)!=null?i:0)&&!(o.matchCriteria&(h.Text|h.Node))?(this.transitionForward(s),!0):!1}transitionIfTextMatch(t,e){var r;const s=this.getNextState(),n=this.getCurrentState();return s==null?!1:(s.toCacheNodeProps&u.Text&&(this._cachedNodeProps.text=t),s.matchesText(t)&&s.matchesDepth(e,(r=n==null?void 0:n.enteredDepth)!=null?r:0)&&!(s.matchCriteria&h.Node)?(this.transitionForward(e),!0):!1)}transitionForward(t){const e=this.getCurrentState();e!=null&&e.unmatch(),this._currentState=this._currentState!=null?this._currentState+1:0;const r=this.getCurrentState();r!=null&&r.match(t),this.isFinalState()&&(this._toRecordTokens=this._cachedTokens),this.resetCurrentStateCache()}transitionBack(t){const e=this.getCurrentState();e!=null&&e.unmatch(),this._currentState=this._currentState!=null?this._currentState-1:0;const r=this.getCurrentState();r!=null&&r.match(t),this.resetCurrentStateCache()}isFinalState(){return this._currentState!=null&&this._currentState>=this._states.length-1}getOffsetToFinal(){return this._currentState==null?this._states.length:this._states.length-1-this._currentState}resetCurrentStateCache(){this._cachedNodeProps.prefix=null,this._cachedNodeProps.local=null,this._cachedNodeProps.attributes=null,this._cachedNodeProps.text=null,this._cachedTokens=[]}}export{m as TokenSelectStateMachine};
1
+ import{TokenSelectState as _,EToCacheNodeProps as u,ETokenMatchCriteria as h}from"./TokenSelectState.js";var S=Object.defineProperty,p=(n,t,e)=>t in n?S(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,c=(n,t,e)=>p(n,typeof t!="symbol"?t+"":t,e);class N{constructor(t){c(this,"_states"),c(this,"_currentState",null),c(this,"_cachedNodeProps",{prefix:null,local:null,attributes:null,text:null}),c(this,"_cachedTokens",[]),c(this,"_toRecordTokens",[]),this._states=t.map(e=>new _(e))}getNextState(){var t;const e=this._currentState!=null?this._currentState+1:0;return e<this._states.length&&(t=this._states[e])!=null?t:null}getCurrentState(){var t;return this._currentState!=null&&this._currentState<this._states.length&&(t=this._states[this._currentState])!=null?t:null}record(t){this.getOffsetToFinal()<=1&&this._cachedTokens.push(t)}takeRecordedTokens(){if(this._toRecordTokens.length>0){const t=this._toRecordTokens;return this._toRecordTokens=[],t}return null}transitionIfNameMatch(t,e,r){var s;const a=this.getNextState(),i=this.getCurrentState();return a==null?!1:(a.toCacheNodeProps&u.Name&&(this._cachedNodeProps.local=t,this._cachedNodeProps.prefix=e),a.matchesName(t,e)&&a.matchesDepth(r,(s=i==null?void 0:i.enteredDepth)!=null?s:0)&&!(a.matchCriteria&(h.Attributes|h.Text|h.Node))?(this.transitionForward(r),!0):!1)}transitionIfAttributesMatch(t,e,r,s){var a,i;const o=this.getNextState(),d=this.getCurrentState();if(o==null)return!1;const l=(a=this._cachedNodeProps.attributes)!=null?a:[];return l.push({local:t,prefix:e,value:r}),o.toCacheNodeProps&u.Attributes&&(this._cachedNodeProps.attributes=l),o.matchesAttributes(l)&&o.matchesDepth(s,(i=d==null?void 0:d.enteredDepth)!=null?i:0)&&!(o.matchCriteria&(h.Text|h.Node))?(this.transitionForward(s),!0):!1}transitionIfTextMatch(t,e){var r;const s=this.getNextState(),a=this.getCurrentState();return s==null?!1:(s.toCacheNodeProps&u.Text&&(this._cachedNodeProps.text=t),s.matchesText(t)&&s.matchesDepth(e,(r=a==null?void 0:a.enteredDepth)!=null?r:0)&&!(s.matchCriteria&h.Node)?(this.transitionForward(e),!0):!1)}transitionForward(t){const e=this.getCurrentState();e!=null&&e.unmatch(),this._currentState=this._currentState!=null?this._currentState+1:0;const r=this.getCurrentState();r!=null&&r.match(t),this.isFinalState()&&(this._toRecordTokens=this._cachedTokens),this.resetCurrentStateCache()}transitionBack(t){const e=this.getCurrentState();e!=null&&e.unmatch(),this._currentState=this._currentState!=null?this._currentState-1:0;const r=this.getCurrentState();r!=null&&r.match(t),this.resetCurrentStateCache()}isFinalState(){return this._currentState!=null&&this._currentState>=this._states.length-1}getOffsetToFinal(){return this._currentState==null?this._states.length:this._states.length-1-this._currentState}resetCurrentStateCache(){this._cachedNodeProps.prefix=null,this._cachedNodeProps.local=null,this._cachedNodeProps.attributes=null,this._cachedNodeProps.text=null,this._cachedTokens=[]}}export{N as TokenSelectStateMachine};
@@ -0,0 +1 @@
1
+ function a(t,e){if(typeof e=="string")return t===e;switch(e.matchStrategy){case"ANY":return!0;case"EXACT":return t===e.value;case"CONTAINS":return t.includes(e.value);case"STARTS_WITH":return t.startsWith(e.value);case"ENDS_WITH":return t.endsWith(e.value)}}export{a as matchString};
@@ -1 +1 @@
1
- import{getQName as r}from"./get-q-name.js";import{tokenize as i}from"./tokenizer/tokenize.js";function s(o,l=!1){const t={},e=[t];return i(o,l,c=>{a(c,e)}),t}function a(o,l){switch(o.type){case"ElementStart":{const t=r(o.local,o.prefix),e=`_${t}`,c={},n=l[l.length-1];n!=null&&(n.content!=null?(c.tag=t,n.content.push(c)):n.text!=null?(c.tag=t,n.content=[n.text,c],delete n.text):n[e]==null?n[e]=c:Array.isArray(n[e])?n[e].push(c):n[e]=[n[e],c]),l.push(c);break}case"ElementEnd":{(o.end.type==="Close"||o.end.type==="Empty")&&l.pop();break}case"Attribute":{const t=l[l.length-1];if(t!=null){const e=r(o.local,o.prefix);t.attributes!=null?t.attributes[e]=o.value:t.attributes={[e]:o.value}}break}case"Text":case"Cdata":{const t=l[l.length-1];if(t!=null){const e=o.text.trim();e.length>0&&(t.content!=null?t.content.push(e):t.text!=null?(t.content=[t.text,e],delete t.text):t.text=e)}break}}}export{a as processTokenForSimplifiedObject,s as xmlToSimplifiedObject};
1
+ import{getQName as c}from"./get-q-name.js";import{tokenize as i}from"./tokenizer/tokenize.js";function s(o,l=!1){const t={},e=[t];return i(o,l,r=>{a(r,e)}),t}function a(o,l){switch(o.type){case"ElementStart":{const t=c(o.local,o.prefix),e=`_${t}`,r={},n=l[l.length-1];n!=null&&(n.content!=null?(r.tag=t,n.content.push(r)):n.text!=null?(r.tag=t,n.content=[n.text,r],delete n.text):n[e]==null?n[e]=[r]:Array.isArray(n[e])?n[e].push(r):n[e]=[n[e],r]),l.push(r);break}case"ElementEnd":{(o.end.type==="Close"||o.end.type==="Empty")&&l.pop();break}case"Attribute":{const t=l[l.length-1];if(t!=null){const e=c(o.local,o.prefix);t.attributes!=null?t.attributes[e]=o.value:t.attributes={[e]:o.value}}break}case"Text":case"Cdata":{const t=l[l.length-1];if(t!=null){const e=o.text.trim();e.length>0&&(t.content!=null?t.content.push(e):t.text!=null?(t.content=[t.text,e],delete t.text):t.text=e)}break}}}export{a as processTokenForSimplifiedObject,s as xmlToSimplifiedObject};
@@ -1,3 +1,4 @@
1
+ import { type TCachedAttribute } from './TokenSelectStateMachine';
1
2
  import { type TTokenSelectPathSegment } from './types';
2
3
  export declare class TokenSelectState {
3
4
  private _segment;
@@ -10,7 +11,7 @@ export declare class TokenSelectState {
10
11
  get enteredDepth(): number | null;
11
12
  private applyLevels;
12
13
  matchesName(local: string, prefix: string): boolean;
13
- matchesAttributes(attributes: Record<string, string>): boolean;
14
+ matchesAttributes(attributes: TCachedAttribute[]): boolean;
14
15
  matchesText(text: string): boolean;
15
16
  matchesDepth(depth: number, parentDepth: number): boolean;
16
17
  match(depth: number): void;
@@ -1 +1 @@
1
- {"version":3,"file":"TokenSelectState.d.ts","sourceRoot":"","sources":["../../../src/selector/TokenSelectState.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAEvD,qBAAa,gBAAgB;IAC5B,OAAO,CAAC,QAAQ,CAA0B;IAC1C,OAAO,CAAC,cAAc,CAAiD;IACvE,OAAO,CAAC,iBAAiB,CAA6C;IACtE,OAAO,CAAC,aAAa,CAAuB;gBAEhC,OAAO,EAAE,uBAAuB;IAK5C,IAAW,aAAa,IAAI,mBAAmB,CAE9C;IAED,IAAW,gBAAgB,IAAI,iBAAiB,CAE/C;IAED,IAAW,YAAY,IAAI,MAAM,GAAG,IAAI,CAEvC;IAED,OAAO,CAAC,WAAW;IAuBZ,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO;IAWnD,iBAAiB,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO;IAe9D,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAIlC,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO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AAI;IAI1B,OAAO,IAAI,IAAI;CAGtB;AAED,0BAAkB,iBAAiB;IAClC,IAAI,IAAI,CAAE,aAAa;IACvB,IAAI,IAAS,CAAE,uCAAuC;IACtD,UAAU,IAAS,CAAE,+CAA+C;IACpE,IAAI,IAAS;CACb;AAED,0BAAkB,mBAAmB;IACpC,IAAI,IAAI,CAAE,aAAa;IACvB,IAAI,IAAS,CAAE,uCAAuC;IACtD,UAAU,IAAS,CAAE,+CAA+C;IACpE,IAAI,IAAS,CAAE,sDAAsD;IACrE,IAAI,IAAS;CACb"}
@@ -21,4 +21,15 @@ export declare class TokenSelectStateMachine {
21
21
  getOffsetToFinal(): number;
22
22
  resetCurrentStateCache(): void;
23
23
  }
24
+ export interface TCachedNodeProps {
25
+ prefix: string | null;
26
+ local: string | null;
27
+ attributes: TCachedAttribute[] | null;
28
+ text: string | null;
29
+ }
30
+ export interface TCachedAttribute {
31
+ local: string;
32
+ prefix?: string;
33
+ value?: string;
34
+ }
24
35
  //# sourceMappingURL=TokenSelectStateMachine.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TokenSelectStateMachine.d.ts","sourceRoot":"","sources":["../../../src/selector/TokenSelectStateMachine.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAA0C,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC9F,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhD,qBAAa,uBAAuB;IACnC,OAAO,CAAC,OAAO,CAAqB;IAGpC,OAAO,CAAC,aAAa,CAAuB;IAG5C,OAAO,CAAC,gBAAgB,CAKtB;IACF,OAAO,CAAC,aAAa,CAAmB;IACxC,OAAO,CAAC,eAAe,CAAmB;gBAE9B,eAAe,EAAE,gBAAgB;IAItC,YAAY,IAAI,gBAAgB,GAAG,IAAI;IAQvC,eAAe,IAAI,gBAAgB,GAAG,IAAI;IAO1C,MAAM,CAA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AE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO;IA8B5E,2BAA2B,CACjC,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,GACX,OAAO;IA4BH,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO;IAwBlE,OAAO,CAAC,iBAAiB;IAmBlB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAgBnC,YAAY,IAAI,OAAO;IAIvB,gBAAgB,IAAI,MAAM;IAO1B,sBAAsB,IAAI,IAAI;CAOrC;AAED,MAAM,WAAW,gBAAgB;IAChC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,UAAU,EAAE,gBAAgB,EAAE,GAAG,IAAI,CAAC;IACtC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACpB;AAED,MAAM,WAAW,gBAAgB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CACf"}
@@ -0,0 +1,3 @@
1
+ import { type TStringMatch } from './types';
2
+ export declare function matchString(value: string, config: TStringMatch): boolean;
3
+ //# sourceMappingURL=match-string.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"match-string.d.ts","sourceRoot":"","sources":["../../../src/selector/match-string.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,GAAG,OAAO,CAkBxE"}
@@ -1,8 +1,10 @@
1
1
  import { type TXmlToken } from '../tokenizer';
2
- export type TSelectedXmlToken = TXmlToken | {
2
+ export type TSelectedXmlToken = (TXmlToken | {
3
3
  type: 'SelectionStart';
4
4
  } | {
5
5
  type: 'SelectionEnd';
6
+ }) & {
7
+ key?: string;
6
8
  };
7
9
  export type TSelectedTokenCallback = (token: TSelectedXmlToken) => void;
8
10
  /**
@@ -21,6 +23,7 @@ export type TSelectedTokenCallback = (token: TSelectedXmlToken) => void;
21
23
  * ];
22
24
  */
23
25
  export interface TTokenSelectPathSegment {
26
+ key?: string;
24
27
  /**
25
28
  * Specifies the axis defining the relationship between nodes.
26
29
  *
@@ -29,15 +32,13 @@ export interface TTokenSelectPathSegment {
29
32
  */
30
33
  axis: 'child' | 'self-or-descendant';
31
34
  /**
32
- * The local name of the node to match.
33
- *
34
- * Use '*' to match any node.
35
+ * Optional local name of the node to match.
35
36
  */
36
- local?: string | '*';
37
+ local?: TStringMatch;
37
38
  /**
38
- * An optional namespace prefix to qualify the node name.
39
+ * Optional namespace prefix to qualify the node name.
39
40
  */
40
- prefix?: string;
41
+ prefix?: TStringMatch;
41
42
  /**
42
43
  * Optional filters based on node attributes.
43
44
  *
@@ -46,9 +47,9 @@ export interface TTokenSelectPathSegment {
46
47
  * attributes: [\{ local: 'category', value: 'fiction' \}]
47
48
  */
48
49
  attributes?: {
49
- local: string;
50
- prefix?: string;
51
- value?: string;
50
+ local?: TStringMatch;
51
+ prefix?: TStringMatch;
52
+ value?: TStringMatch;
52
53
  }[];
53
54
  /**
54
55
  * Optional filter to match nodes containing specific text content.
@@ -60,23 +61,17 @@ export interface TTokenSelectPathSegment {
60
61
  * // Matches nodes containing the text 'bestseller'
61
62
  * containsText: 'bestseller'
62
63
  */
63
- containsText?: string;
64
- /**
65
- * Optional custom predicate function to further filter nodes.
66
- *
67
- * @example
68
- * // Custom predicate to match nodes with specific characteristics
69
- * predicate: (node) =\> node.local === 'title'
70
- */
71
- predicate?: (node: {
72
- local: string;
73
- prefix?: string;
74
- attributes: Record<string, string>;
75
- text?: string;
76
- }) => boolean;
64
+ text?: TStringMatch;
77
65
  }
78
66
  /**
79
67
  * A limited XPath expression composed of multiple segments in an object-oriented manner.
80
68
  */
81
69
  export type TTokenSelectPath = TTokenSelectPathSegment[];
70
+ export type TStringMatchStrategy = 'EXACT' | 'CONTAINS' | 'STARTS_WITH' | 'ENDS_WITH' | 'ANY';
71
+ export type TStringMatch = string | {
72
+ matchStrategy: 'ANY';
73
+ } | {
74
+ matchStrategy: Exclude<TStringMatchStrategy, 'ANY'>;
75
+ value: string;
76
+ };
82
77
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/selector/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG;IAAE,IAAI,EAAE,gBAAgB,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,cAAc,CAAA;CAAE,CAAC;AAElG,MAAM,MAAM,sBAAsB,GAAG,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAC;AAExE;;;;;;;;;;;;;;GAcG;AAGH,MAAM,WAAW,uBAAuB;IACvC;;;;;OAKG;IACH,IAAI,EAAE,OAAO,GAAG,oBAAoB,CAAC;IAErC;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;IAErB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;;;OAMG;IACH,UAAU,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAElE;;;;;;;;;OASG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE;QAClB,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,UAAU,EAAE,MAAM,CA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GACN;IAAE,aAAa,EAAE,KAAK,CAAA;CAAE,GACxB;IACA,aAAa,EAAE,OAAO,CAAC,oBAAoB,EAAE,KAAK,CAAC,CAAC;IACpD,KAAK,EAAE,MAAM,CAAC;CACb,CAAC"}
@@ -6,8 +6,7 @@ export interface TSimplifiedXmlNode {
6
6
  attributes?: Record<string, string>;
7
7
  text?: string;
8
8
  content?: (string | TSimplifiedXmlNode)[];
9
- [key: TSimplifiedXmlNodeTagName]: TSimplifiedXmlNode | TSimplifiedXmlNode[];
9
+ [key: TSimplifiedXmlNodeTagName]: TSimplifiedXmlNode[];
10
10
  }
11
- type TSimplifiedXmlNodeTagName = `_${string}`;
12
- export {};
11
+ export type TSimplifiedXmlNodeTagName = `_${string}`;
13
12
  //# sourceMappingURL=xml-to-simplified-object.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"xml-to-simplified-object.d.ts","sourceRoot":"","sources":["../../src/xml-to-simplified-object.ts"],"names":[],"mappings":"AACA,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AAEvD,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,UAAQ,GAAG,kBAAkB,CAS7F;AAED,wBAAgB,+BAA+B,CAC9C,KAAK,EAAE,SAAS,EAChB,KAAK,EAAE,kBAAkB,EAAE,GACzB,IAAI,CAsEN;AAED,MAAM,WAAW,kBAAkB;IAClC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,CAAC,MAAM,GAAG,kBAAkB,CAAC,EAAE,CAAC;IAE1C,CAAC,GAAG,EAAE,yBAAyB,GAAG,kBAAkB,GAAG,kBAAkB,EAAE,CAAC;CAC5E;AAED,KAAK,yBAAyB,GAAG,IAAI,MAAM,EAAE,CAAC"}
1
+ {"version":3,"file":"xml-to-simplified-object.d.ts","sourceRoot":"","sources":["../../src/xml-to-simplified-object.ts"],"names":[],"mappings":"AACA,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AAEvD,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,UAAQ,GAAG,kBAAkB,CAS7F;AAED,wBAAgB,+BAA+B,CAC9C,KAAK,EAAE,SAAS,EAChB,KAAK,EAAE,kBAAkB,EAAE,GACzB,IAAI,CAsEN;AAED,MAAM,WAAW,kBAAkB;IAClC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,CAAC,MAAM,GAAG,kBAAkB,CAAC,EAAE,CAAC;IAE1C,CAAC,GAAG,EAAE,yBAAyB,GAAG,kBAAkB,EAAE,CAAC;CACvD;AAED,MAAM,MAAM,yBAAyB,GAAG,IAAI,MAAM,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xml-tokenizer",
3
- "version": "0.0.10",
3
+ "version": "0.0.12",
4
4
  "description": "Straightforward and typesafe XML tokenizer that streams tokens through a callback mechanism",
5
5
  "private": false,
6
6
  "source": "./src/index.ts",
@@ -28,7 +28,7 @@
28
28
  "saxen": "^10.0.0",
29
29
  "txml": "^5.1.1",
30
30
  "xml2js": "^0.6.2",
31
- "@blgc/config": "0.0.17"
31
+ "@blgc/config": "0.0.22"
32
32
  },
33
33
  "files": [
34
34
  "dist",