@loaders.gl/xml 4.3.2 → 4.3.4
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/dist/dist.min.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/xml-loader.js +1 -1
- package/package.json +4 -4
package/dist/dist.min.js
CHANGED
|
@@ -18,6 +18,6 @@ Line: ${this.line}
|
|
|
18
18
|
Column: ${this.column}
|
|
19
19
|
Char: ${this.c}`);let i=new Error(t);return this.error=i,this.emit("onerror",i),this}attrib(){if(this.strict||(this.attribName=this.attribName[this.looseCase]()),this.attribList.indexOf(this.attribName)!==-1||this.tag.attributes.hasOwnProperty(this.attribName)){this.attribName=this.attribValue="";return}if(this.opt.xmlns){let t=f.qname(this.attribName,!0),i=t.prefix,s=t.local;if(i==="xmlns")if(s==="xml"&&this.attribValue!==this.XML_NAMESPACE)this.strictFail(`xml: prefix must be bound to ${this.XML_NAMESPACE}
|
|
20
20
|
Actual: ${this.attribValue}`);else if(s==="xmlns"&&this.attribValue!==this.XMLNS_NAMESPACE)this.strictFail(`xmlns: prefix must be bound to ${this.XMLNS_NAMESPACE}
|
|
21
|
-
Actual: ${this.attribValue}`);else{let r=this.tag,n=this.tags[this.tags.length-1]||this;r.ns===n.ns&&(r.ns=Object.create(n.ns)),r.ns[s]=this.attribValue}this.attribList.push([this.attribName,this.attribValue])}else this.tag.attributes[this.attribName]=this.attribValue,this.emitNode("onattribute",{name:this.attribName,value:this.attribValue});this.attribName=this.attribValue=""}newTag(){this.strict||(this.tagName=this.tagName[this.looseCase]());let t=this.tags[this.tags.length-1]||this,i=this.tag={name:this.tagName,attributes:{}};this.opt.xmlns&&(i.ns=t.ns),this.attribList.length=0,this.emitNode("onopentagstart",i)}parseEntity(){let t=this.entity,i=t.toLowerCase(),s=NaN,r="";return this.ENTITIES[t]?this.ENTITIES[t]:this.ENTITIES[i]?this.ENTITIES[i]:(t=i,t.charAt(0)==="#"&&(t.charAt(1)==="x"?(t=t.slice(2),s=parseInt(t,16),r=s.toString(16)):(t=t.slice(1),s=parseInt(t,10),r=s.toString(10))),t=t.replace(/^0+/,""),isNaN(s)||r.toLowerCase()!==t?(this.strictFail("Invalid character entity"),`&${this.entity};`):String.fromCodePoint(s))}beginWhiteSpace(t){t==="<"?(this.state=this.S.OPEN_WAKA,this.startTagPosition=this.position):f.isWhitespace(t)||(this.strictFail("Non-whitespace before first tag."),this.textNode=t,this.state=this.S.TEXT)}strictFail(t){if(typeof this!="object"||!(this instanceof A))throw new Error("bad call to strictFail");this.strict&&this.errorFunction(t)}textApplyOptions(t){return this.opt.trim&&(t=t.trim()),this.opt.normalize&&(t=t.replace(/\s+/g," ")),t}emitNode(t,i){this.textNode&&this.closeText(),this.emit(t,i)}closeText(){this.textNode=this.textApplyOptions(this.textNode),this.textNode!==void 0&&this.textNode!==""&&this.textNode!=="undefined"&&this.emit("ontext",this.textNode),this.textNode=""}checkBufferLength(){let t=Math.max(this.opt.MAX_BUFFER_LENGTH,10),i=0;for(let r=0,n=this.BUFFERS.length;r<n;r++){let a=this[this.BUFFERS[r]]?.length||0;if(a>t)switch(this.BUFFERS[r]){case"textNode":this.closeText();break;case"cdata":this.emitNode("oncdata",this.cdata),this.cdata="";break;case"script":this.emitNode("onscript",this.script),this.script="";break;default:this.errorFunction(`Max buffer length exceeded: ${this.BUFFERS[r]}`)}i=Math.max(i,a)}let s=this.opt.MAX_BUFFER_LENGTH-i;this.bufferCheckPosition=s+this.position}openTag(t){if(this.opt.xmlns){let i=this.tag,s=f.qname(this.tagName);i.prefix=s.prefix,i.local=s.local,i.uri=i.ns[s.prefix]||"",i.prefix&&!i.uri&&(this.strictFail(`Unbound namespace prefix: ${JSON.stringify(this.tagName)}`),i.uri=s.prefix);let r=this.tags[this.tags.length-1]||this;if(i.ns&&r.ns!==i.ns){let n=this;Object.keys(i.ns).forEach(a=>{n.emitNode("onopennamespace",{prefix:a,uri:i.ns[a]})})}for(let n=0,a=this.attribList.length;n<a;n++){let h=this.attribList[n],o=h[0],c=h[1],u=f.qname(o,!0),l=u.prefix,p=u.local,N=l===""?"":i.ns[l]||"",d={name:o,value:c,prefix:l,local:p,uri:N};l&&l!=="xmlns"&&!N&&(this.strictFail(`Unbound namespace prefix: ${JSON.stringify(l)}`),d.uri=l),this.tag.attributes[o]=d,this.emitNode("onattribute",d)}this.attribList.length=0}this.tag.isSelfClosing=Boolean(t),this.sawRoot=!0,this.tags.push(this.tag),this.emitNode("onopentag",this.tag),t||(!this.noscript&&this.tagName.toLowerCase()==="script"?this.state=this.S.SCRIPT:this.state=this.S.TEXT,this.tag=null,this.tagName=""),this.attribName=this.attribValue="",this.attribList.length=0}closeTag(){if(!this.tagName){this.strictFail("Weird empty close tag."),this.textNode+="</>",this.state=this.S.TEXT;return}if(this.script){if(this.tagName!=="script"){this.script+=`</${this.tagName}>`,this.tagName="",this.state=this.S.SCRIPT;return}this.emitNode("onscript",this.script),this.script=""}let t=this.tags.length,i=this.tagName;for(this.strict||(i=i[this.looseCase]());t--&&this.tags[t].name!==i;)this.strictFail("Unexpected close tag");if(t<0){this.strictFail(`Unmatched closing tag: ${this.tagName}`),this.textNode+=`</${this.tagName}>`,this.state=this.S.TEXT;return}this.tagName=i;let s=this.tags.length;for(;s-- >t;){let r=this.tag=this.tags.pop();this.tagName=this.tag.name,this.emitNode("onclosetag",this.tagName);let n={};for(let h in r.ns)r.ns.hasOwnProperty(h)&&(n[h]=r.ns[h]);let a=this.tags[this.tags.length-1]||this;if(this.opt.xmlns&&r.ns!==a.ns){let h=this;Object.keys(r.ns).forEach(o=>{let c=r.ns[o];h.emitNode("onclosenamespace",{prefix:o,uri:c})})}}t===0&&(this.closedRoot=!0),this.tagName=this.attribValue=this.attribName="",this.attribList.length=0,this.state=this.S.TEXT}},A=class extends f{opt=Ht;events=tt;constructor(t){super(),this.clearBuffers(),this.opt=t={...this.opt,...t},this.events={...this.events,...t},this.q=this.c="",this.opt.lowercase=this.opt.lowercase||this.opt.lowercasetags,this.bufferCheckPosition=this.opt.MAX_BUFFER_LENGTH,this.looseCase=this.opt.lowercase?"toLowerCase":"toUpperCase",this.tags=[],this.closed=this.closedRoot=this.sawRoot=!1,this.tag=this.error=null,this.strict=Boolean(this.opt.strict),this.noscript=Boolean(this.opt.strict||this.opt.noscript),this.state=this.S.BEGIN,this.strictEntities=this.opt.strictEntities,this.ENTITIES=this.strictEntities?Object.create(this.XML_ENTITIES):Object.create(this.ENTITIES),this.attribList=[],this.opt.xmlns&&(this.ns=Object.create(this.rootNS)),this.trackPosition=this.opt.position!==!1,this.trackPosition&&(this.position=this.line=this.column=0),this.emit("onready")}resume(){return this.error=null,this}close(){return this.write(null)}flush(){this.flushBuffers()}};J(A,"ENTITIES",_);function v(e){return typeof e=="string"?e.charAt(0).toLowerCase()+e.slice(1):e}function x(e){if(Array.isArray(e))return e.map(t=>x(t));if(e&&typeof e=="object"){let t={};for(let[i,s]of Object.entries(e))t[v(i)]=x(s);return t}return e}var Mt=Z(Bt(),1);function H(e,t){if(t?._parser&&t._parser!=="fast-xml-parser")throw new Error(t?._parser);let i={allowBooleanAttributes:!0,ignoreDeclaration:!0,removeNSPrefix:t?.removeNSPrefix,textNodeName:t?.textNodeName,isArray:(r,n,a,h)=>Boolean(t?.arrayPaths?.some(c=>n===c)),...t?._fastXML},s=cs(e,i);return t?.uncapitalizeKeys?x(s):s}function cs(e,t){return new Mt.XMLParser({ignoreAttributes:!1,attributeNamePrefix:"",...t}).parse(e)}var us="4.3.
|
|
21
|
+
Actual: ${this.attribValue}`);else{let r=this.tag,n=this.tags[this.tags.length-1]||this;r.ns===n.ns&&(r.ns=Object.create(n.ns)),r.ns[s]=this.attribValue}this.attribList.push([this.attribName,this.attribValue])}else this.tag.attributes[this.attribName]=this.attribValue,this.emitNode("onattribute",{name:this.attribName,value:this.attribValue});this.attribName=this.attribValue=""}newTag(){this.strict||(this.tagName=this.tagName[this.looseCase]());let t=this.tags[this.tags.length-1]||this,i=this.tag={name:this.tagName,attributes:{}};this.opt.xmlns&&(i.ns=t.ns),this.attribList.length=0,this.emitNode("onopentagstart",i)}parseEntity(){let t=this.entity,i=t.toLowerCase(),s=NaN,r="";return this.ENTITIES[t]?this.ENTITIES[t]:this.ENTITIES[i]?this.ENTITIES[i]:(t=i,t.charAt(0)==="#"&&(t.charAt(1)==="x"?(t=t.slice(2),s=parseInt(t,16),r=s.toString(16)):(t=t.slice(1),s=parseInt(t,10),r=s.toString(10))),t=t.replace(/^0+/,""),isNaN(s)||r.toLowerCase()!==t?(this.strictFail("Invalid character entity"),`&${this.entity};`):String.fromCodePoint(s))}beginWhiteSpace(t){t==="<"?(this.state=this.S.OPEN_WAKA,this.startTagPosition=this.position):f.isWhitespace(t)||(this.strictFail("Non-whitespace before first tag."),this.textNode=t,this.state=this.S.TEXT)}strictFail(t){if(typeof this!="object"||!(this instanceof A))throw new Error("bad call to strictFail");this.strict&&this.errorFunction(t)}textApplyOptions(t){return this.opt.trim&&(t=t.trim()),this.opt.normalize&&(t=t.replace(/\s+/g," ")),t}emitNode(t,i){this.textNode&&this.closeText(),this.emit(t,i)}closeText(){this.textNode=this.textApplyOptions(this.textNode),this.textNode!==void 0&&this.textNode!==""&&this.textNode!=="undefined"&&this.emit("ontext",this.textNode),this.textNode=""}checkBufferLength(){let t=Math.max(this.opt.MAX_BUFFER_LENGTH,10),i=0;for(let r=0,n=this.BUFFERS.length;r<n;r++){let a=this[this.BUFFERS[r]]?.length||0;if(a>t)switch(this.BUFFERS[r]){case"textNode":this.closeText();break;case"cdata":this.emitNode("oncdata",this.cdata),this.cdata="";break;case"script":this.emitNode("onscript",this.script),this.script="";break;default:this.errorFunction(`Max buffer length exceeded: ${this.BUFFERS[r]}`)}i=Math.max(i,a)}let s=this.opt.MAX_BUFFER_LENGTH-i;this.bufferCheckPosition=s+this.position}openTag(t){if(this.opt.xmlns){let i=this.tag,s=f.qname(this.tagName);i.prefix=s.prefix,i.local=s.local,i.uri=i.ns[s.prefix]||"",i.prefix&&!i.uri&&(this.strictFail(`Unbound namespace prefix: ${JSON.stringify(this.tagName)}`),i.uri=s.prefix);let r=this.tags[this.tags.length-1]||this;if(i.ns&&r.ns!==i.ns){let n=this;Object.keys(i.ns).forEach(a=>{n.emitNode("onopennamespace",{prefix:a,uri:i.ns[a]})})}for(let n=0,a=this.attribList.length;n<a;n++){let h=this.attribList[n],o=h[0],c=h[1],u=f.qname(o,!0),l=u.prefix,p=u.local,N=l===""?"":i.ns[l]||"",d={name:o,value:c,prefix:l,local:p,uri:N};l&&l!=="xmlns"&&!N&&(this.strictFail(`Unbound namespace prefix: ${JSON.stringify(l)}`),d.uri=l),this.tag.attributes[o]=d,this.emitNode("onattribute",d)}this.attribList.length=0}this.tag.isSelfClosing=Boolean(t),this.sawRoot=!0,this.tags.push(this.tag),this.emitNode("onopentag",this.tag),t||(!this.noscript&&this.tagName.toLowerCase()==="script"?this.state=this.S.SCRIPT:this.state=this.S.TEXT,this.tag=null,this.tagName=""),this.attribName=this.attribValue="",this.attribList.length=0}closeTag(){if(!this.tagName){this.strictFail("Weird empty close tag."),this.textNode+="</>",this.state=this.S.TEXT;return}if(this.script){if(this.tagName!=="script"){this.script+=`</${this.tagName}>`,this.tagName="",this.state=this.S.SCRIPT;return}this.emitNode("onscript",this.script),this.script=""}let t=this.tags.length,i=this.tagName;for(this.strict||(i=i[this.looseCase]());t--&&this.tags[t].name!==i;)this.strictFail("Unexpected close tag");if(t<0){this.strictFail(`Unmatched closing tag: ${this.tagName}`),this.textNode+=`</${this.tagName}>`,this.state=this.S.TEXT;return}this.tagName=i;let s=this.tags.length;for(;s-- >t;){let r=this.tag=this.tags.pop();this.tagName=this.tag.name,this.emitNode("onclosetag",this.tagName);let n={};for(let h in r.ns)r.ns.hasOwnProperty(h)&&(n[h]=r.ns[h]);let a=this.tags[this.tags.length-1]||this;if(this.opt.xmlns&&r.ns!==a.ns){let h=this;Object.keys(r.ns).forEach(o=>{let c=r.ns[o];h.emitNode("onclosenamespace",{prefix:o,uri:c})})}}t===0&&(this.closedRoot=!0),this.tagName=this.attribValue=this.attribName="",this.attribList.length=0,this.state=this.S.TEXT}},A=class extends f{opt=Ht;events=tt;constructor(t){super(),this.clearBuffers(),this.opt=t={...this.opt,...t},this.events={...this.events,...t},this.q=this.c="",this.opt.lowercase=this.opt.lowercase||this.opt.lowercasetags,this.bufferCheckPosition=this.opt.MAX_BUFFER_LENGTH,this.looseCase=this.opt.lowercase?"toLowerCase":"toUpperCase",this.tags=[],this.closed=this.closedRoot=this.sawRoot=!1,this.tag=this.error=null,this.strict=Boolean(this.opt.strict),this.noscript=Boolean(this.opt.strict||this.opt.noscript),this.state=this.S.BEGIN,this.strictEntities=this.opt.strictEntities,this.ENTITIES=this.strictEntities?Object.create(this.XML_ENTITIES):Object.create(this.ENTITIES),this.attribList=[],this.opt.xmlns&&(this.ns=Object.create(this.rootNS)),this.trackPosition=this.opt.position!==!1,this.trackPosition&&(this.position=this.line=this.column=0),this.emit("onready")}resume(){return this.error=null,this}close(){return this.write(null)}flush(){this.flushBuffers()}};J(A,"ENTITIES",_);function v(e){return typeof e=="string"?e.charAt(0).toLowerCase()+e.slice(1):e}function x(e){if(Array.isArray(e))return e.map(t=>x(t));if(e&&typeof e=="object"){let t={};for(let[i,s]of Object.entries(e))t[v(i)]=x(s);return t}return e}var Mt=Z(Bt(),1);function H(e,t){if(t?._parser&&t._parser!=="fast-xml-parser")throw new Error(t?._parser);let i={allowBooleanAttributes:!0,ignoreDeclaration:!0,removeNSPrefix:t?.removeNSPrefix,textNodeName:t?.textNodeName,isArray:(r,n,a,h)=>Boolean(t?.arrayPaths?.some(c=>n===c)),...t?._fastXML},s=cs(e,i);return t?.uncapitalizeKeys?x(s):s}function cs(e,t){return new Mt.XMLParser({ignoreAttributes:!1,attributeNamePrefix:"",...t}).parse(e)}var us="4.3.3",y={dataType:null,batchType:null,name:"XML",id:"xml",module:"xml",version:us,worker:!1,extensions:["xml"],mimeTypes:["application/xml","text/xml"],testText:ls,options:{xml:{_parser:"fast-xml-parser",uncapitalizeKeys:!1,removeNSPrefix:!1,textNodeName:"value",arrayPaths:[]}},parse:async(e,t)=>H(new TextDecoder().decode(e),{...y.options.xml,...t?.xml}),parseTextSync:(e,t)=>H(e,{...y.options.xml,...t?.xml})};function ls(e){return e.startsWith("<?xml")}function z(e,t){return Rt(e||{},t)}function Rt(e,t,i=0){if(i>3)return t;let s={...e};for(let[r,n]of Object.entries(t))n&&typeof n=="object"&&!Array.isArray(n)?s[r]=Rt(s[r]||{},t[r],i+1):s[r]=t[r];return s}var vt={...y,name:"HTML",id:"html",extensions:["html","htm"],mimeTypes:["text/html"],testText:fs,parse:async(e,t)=>Vt(new TextDecoder().decode(e),t),parseTextSync:(e,t)=>Vt(e,t)};function fs(e){return e.startsWith("<html")}function Vt(e,t){return t=z(t,{xml:{_parser:"fast-xml-parser",_fastXML:{htmlEntities:!0}}}),y.parseTextSync?.(e,t)}function K(e){return Array.isArray(e)?e:(e&&typeof e=="object"&&e[0],e?[e]:[])}function Ut(e,t){e[t]=K(e[t])}return Qt(L);})();
|
|
22
22
|
return __exports__;
|
|
23
23
|
});
|
package/dist/index.cjs
CHANGED
package/dist/index.cjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["index.js", "sax-ts/sax.js", "lib/xml-utils/uncapitalize.js", "lib/parsers/parse-xml.js", "xml-loader.js", "html-loader.js", "lib/xml-utils/xml-utils.js"],
|
|
4
|
-
"sourcesContent": ["// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nexport { XMLLoader } from \"./xml-loader.js\";\nexport { HTMLLoader } from \"./html-loader.js\";\nexport { SAXParser as SAXParser } from \"./sax-ts/sax.js\";\n// Utilities\nexport { convertXMLValueToArray, convertXMLFieldToArrayInPlace } from \"./lib/xml-utils/xml-utils.js\";\n// Experimental\nexport { uncapitalize as _uncapitalize, uncapitalizeKeys as _uncapitalizeKeys } from \"./lib/xml-utils/uncapitalize.js\";\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nconst DEFAULT_SAX_EVENTS = {\n ontext: () => { },\n onprocessinginstruction: () => { },\n onsgmldeclaration: () => { },\n ondoctype: () => { },\n oncomment: () => { },\n onopentagstart: () => { },\n onattribute: () => { },\n onopentag: () => { },\n onclosetag: () => { },\n onopencdata: () => { },\n oncdata: () => { },\n onclosecdata: () => { },\n onerror: () => { },\n onend: () => { },\n onready: () => { },\n onscript: () => { },\n onopennamespace: () => { },\n onclosenamespace: () => { }\n};\nconst DEFAULT_SAX_PARSER_OPTIONS = {\n ...DEFAULT_SAX_EVENTS,\n strict: false,\n MAX_BUFFER_LENGTH: 64 * 1024,\n lowercase: false,\n lowercasetags: false,\n noscript: false,\n strictEntities: false,\n xmlns: undefined,\n position: undefined,\n trim: undefined,\n normalize: undefined\n};\nconst EVENTS = [\n 'text',\n 'processinginstruction',\n 'sgmldeclaration',\n 'doctype',\n 'comment',\n 'opentagstart',\n 'attribute',\n 'opentag',\n 'closetag',\n 'opencdata',\n 'cdata',\n 'closecdata',\n 'error',\n 'end',\n 'ready',\n 'script',\n 'opennamespace',\n 'closenamespace'\n];\nconst BUFFERS = [\n 'comment',\n 'sgmlDecl',\n 'textNode',\n 'tagName',\n 'doctype',\n 'procInstName',\n 'procInstBody',\n 'entity',\n 'attribName',\n 'attribValue',\n 'cdata',\n 'script'\n];\nconst nameStart = /[:_A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]/;\nconst nameBody = /[:_A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\u00B7\\u0300-\\u036F\\u203F-\\u2040.\\d-]/;\nconst entityStart = /[#:_A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]/;\nconst entityBody = /[#:_A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\u00B7\\u0300-\\u036F\\u203F-\\u2040.\\d-]/;\nexport const ENTITIES = {\n amp: '&',\n gt: '>',\n lt: '<',\n quot: '\"',\n apos: \"'\",\n AElig: 198,\n Aacute: 193,\n Acirc: 194,\n Agrave: 192,\n Aring: 197,\n Atilde: 195,\n Auml: 196,\n Ccedil: 199,\n ETH: 208,\n Eacute: 201,\n Ecirc: 202,\n Egrave: 200,\n Euml: 203,\n Iacute: 205,\n Icirc: 206,\n Igrave: 204,\n Iuml: 207,\n Ntilde: 209,\n Oacute: 211,\n Ocirc: 212,\n Ograve: 210,\n Oslash: 216,\n Otilde: 213,\n Ouml: 214,\n THORN: 222,\n Uacute: 218,\n Ucirc: 219,\n Ugrave: 217,\n Uuml: 220,\n Yacute: 221,\n aacute: 225,\n acirc: 226,\n aelig: 230,\n agrave: 224,\n aring: 229,\n atilde: 227,\n auml: 228,\n ccedil: 231,\n eacute: 233,\n ecirc: 234,\n egrave: 232,\n eth: 240,\n euml: 235,\n iacute: 237,\n icirc: 238,\n igrave: 236,\n iuml: 239,\n ntilde: 241,\n oacute: 243,\n ocirc: 244,\n ograve: 242,\n oslash: 248,\n otilde: 245,\n ouml: 246,\n szlig: 223,\n thorn: 254,\n uacute: 250,\n ucirc: 251,\n ugrave: 249,\n uuml: 252,\n yacute: 253,\n yuml: 255,\n copy: 169,\n reg: 174,\n nbsp: 160,\n iexcl: 161,\n cent: 162,\n pound: 163,\n curren: 164,\n yen: 165,\n brvbar: 166,\n sect: 167,\n uml: 168,\n ordf: 170,\n laquo: 171,\n not: 172,\n shy: 173,\n macr: 175,\n deg: 176,\n plusmn: 177,\n sup1: 185,\n sup2: 178,\n sup3: 179,\n acute: 180,\n micro: 181,\n para: 182,\n middot: 183,\n cedil: 184,\n ordm: 186,\n raquo: 187,\n frac14: 188,\n frac12: 189,\n frac34: 190,\n iquest: 191,\n times: 215,\n divide: 247,\n OElig: 338,\n oelig: 339,\n Scaron: 352,\n scaron: 353,\n Yuml: 376,\n fnof: 402,\n circ: 710,\n tilde: 732,\n Alpha: 913,\n Beta: 914,\n Gamma: 915,\n Delta: 916,\n Epsilon: 917,\n Zeta: 918,\n Eta: 919,\n Theta: 920,\n Iota: 921,\n Kappa: 922,\n Lambda: 923,\n Mu: 924,\n Nu: 925,\n Xi: 926,\n Omicron: 927,\n Pi: 928,\n Rho: 929,\n Sigma: 931,\n Tau: 932,\n Upsilon: 933,\n Phi: 934,\n Chi: 935,\n Psi: 936,\n Omega: 937,\n alpha: 945,\n beta: 946,\n gamma: 947,\n delta: 948,\n epsilon: 949,\n zeta: 950,\n eta: 951,\n theta: 952,\n iota: 953,\n kappa: 954,\n lambda: 955,\n mu: 956,\n nu: 957,\n xi: 958,\n omicron: 959,\n pi: 960,\n rho: 961,\n sigmaf: 962,\n sigma: 963,\n tau: 964,\n upsilon: 965,\n phi: 966,\n chi: 967,\n psi: 968,\n omega: 969,\n thetasym: 977,\n upsih: 978,\n piv: 982,\n ensp: 8194,\n emsp: 8195,\n thinsp: 8201,\n zwnj: 8204,\n zwj: 8205,\n lrm: 8206,\n rlm: 8207,\n ndash: 8211,\n mdash: 8212,\n lsquo: 8216,\n rsquo: 8217,\n sbquo: 8218,\n ldquo: 8220,\n rdquo: 8221,\n bdquo: 8222,\n dagger: 8224,\n Dagger: 8225,\n bull: 8226,\n hellip: 8230,\n permil: 8240,\n prime: 8242,\n Prime: 8243,\n lsaquo: 8249,\n rsaquo: 8250,\n oline: 8254,\n frasl: 8260,\n euro: 8364,\n image: 8465,\n weierp: 8472,\n real: 8476,\n trade: 8482,\n alefsym: 8501,\n larr: 8592,\n uarr: 8593,\n rarr: 8594,\n darr: 8595,\n harr: 8596,\n crarr: 8629,\n lArr: 8656,\n uArr: 8657,\n rArr: 8658,\n dArr: 8659,\n hArr: 8660,\n forall: 8704,\n part: 8706,\n exist: 8707,\n empty: 8709,\n nabla: 8711,\n isin: 8712,\n notin: 8713,\n ni: 8715,\n prod: 8719,\n sum: 8721,\n minus: 8722,\n lowast: 8727,\n radic: 8730,\n prop: 8733,\n infin: 8734,\n ang: 8736,\n and: 8743,\n or: 8744,\n cap: 8745,\n cup: 8746,\n int: 8747,\n there4: 8756,\n sim: 8764,\n cong: 8773,\n asymp: 8776,\n ne: 8800,\n equiv: 8801,\n le: 8804,\n ge: 8805,\n sub: 8834,\n sup: 8835,\n nsub: 8836,\n sube: 8838,\n supe: 8839,\n oplus: 8853,\n otimes: 8855,\n perp: 8869,\n sdot: 8901,\n lceil: 8968,\n rceil: 8969,\n lfloor: 8970,\n rfloor: 8971,\n lang: 9001,\n rang: 9002,\n loz: 9674,\n spades: 9824,\n clubs: 9827,\n hearts: 9829,\n diams: 9830\n};\nObject.keys(ENTITIES).forEach((key) => {\n const e = ENTITIES[key];\n ENTITIES[key] = typeof e === 'number' ? String.fromCharCode(e) : e;\n});\n/**\n * Internal helper class\n */\nclass SAX {\n EVENTS = EVENTS;\n ENTITIES = {\n // TODO: make it readonly, needed for entity-mega test\n // amp, gt, lt, quot and apos are resolved to strings instead of numerical\n // codes, IDK why\n ...ENTITIES\n };\n XML_ENTITIES = {\n amp: '&',\n gt: '>',\n lt: '<',\n quot: '\"',\n apos: \"'\"\n };\n S = 0;\n opt;\n trackPosition = false;\n column = 0;\n line = 0;\n c = '';\n error;\n q = '';\n bufferCheckPosition;\n closed = false;\n tags = [];\n looseCase = '';\n closedRoot = false;\n sawRoot = false;\n strict = false;\n tag;\n strictEntities;\n state;\n noscript = false;\n attribList = [];\n ns;\n position = 0;\n STATE = {\n BEGIN: this.S++, // leading byte order mark or whitespace\n BEGIN_WHITESPACE: this.S++, // leading whitespace\n TEXT: this.S++, // general stuff\n TEXT_ENTITY: this.S++, // & and such.\n OPEN_WAKA: this.S++, // <\n SGML_DECL: this.S++, // <!BLARG\n SGML_DECL_QUOTED: this.S++, // <!BLARG foo \"bar\n DOCTYPE: this.S++, // <!DOCTYPE\n DOCTYPE_QUOTED: this.S++, // <!DOCTYPE \"//blah\n DOCTYPE_DTD: this.S++, // <!DOCTYPE \"//blah\" [ ...\n DOCTYPE_DTD_QUOTED: this.S++, // <!DOCTYPE \"//blah\" [ \"foo\n COMMENT_STARTING: this.S++, // <!-\n COMMENT: this.S++, // <!--\n COMMENT_ENDING: this.S++, // <!-- blah -\n COMMENT_ENDED: this.S++, // <!-- blah --\n CDATA: this.S++, // <![CDATA[ something\n CDATA_ENDING: this.S++, // ]\n CDATA_ENDING_2: this.S++, // ]]\n PROC_INST: this.S++, // <?hi\n PROC_INST_BODY: this.S++, // <?hi there\n PROC_INST_ENDING: this.S++, // <?hi \"there\" ?\n OPEN_TAG: this.S++, // <strong\n OPEN_TAG_SLASH: this.S++, // <strong /\n ATTRIB: this.S++, // <a\n ATTRIB_NAME: this.S++, // <a foo\n ATTRIB_NAME_SAW_WHITE: this.S++, // <a foo _\n ATTRIB_VALUE: this.S++, // <a foo=\n ATTRIB_VALUE_QUOTED: this.S++, // <a foo=\"bar\n ATTRIB_VALUE_CLOSED: this.S++, // <a foo=\"bar\"\n ATTRIB_VALUE_UNQUOTED: this.S++, // <a foo=bar\n ATTRIB_VALUE_ENTITY_Q: this.S++, // <foo bar=\""\"\n ATTRIB_VALUE_ENTITY_U: this.S++, // <foo bar="\n CLOSE_TAG: this.S++, // </a\n CLOSE_TAG_SAW_WHITE: this.S++, // </a >\n SCRIPT: this.S++, // <script> ...\n SCRIPT_ENDING: this.S++ // <script> ... <\n };\n BUFFERS = BUFFERS;\n // private parser: (strict: boolean, opt: any) => SAXParser;\n CDATA = '[CDATA[';\n DOCTYPE = 'DOCTYPE';\n XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace';\n XMLNS_NAMESPACE = 'http://www.w3.org/2000/xmlns/';\n rootNS = {\n xml: this.XML_NAMESPACE,\n xmlns: this.XMLNS_NAMESPACE\n };\n comment;\n sgmlDecl;\n textNode = '';\n tagName;\n doctype;\n procInstName;\n procInstBody;\n entity = '';\n attribName;\n attribValue;\n cdata = '';\n script = '';\n startTagPosition = 0;\n constructor() {\n this.S = 0;\n for (const s in this.STATE) {\n if (this.STATE.hasOwnProperty(s)) {\n this.STATE[this.STATE[s]] = s;\n }\n }\n // shorthand\n this.S = this.STATE;\n }\n static charAt(chunk, i) {\n let result = '';\n if (i < chunk.length) {\n result = chunk.charAt(i);\n }\n return result;\n }\n static isWhitespace(c) {\n return c === ' ' || c === '\\n' || c === '\\r' || c === '\\t';\n }\n static isQuote(c) {\n return c === '\"' || c === \"'\";\n }\n static isAttribEnd(c) {\n return c === '>' || SAX.isWhitespace(c);\n }\n static isMatch(regex, c) {\n return regex.test(c);\n }\n static notMatch(regex, c) {\n return !SAX.isMatch(regex, c);\n }\n static qname(name, attribute) {\n const i = name.indexOf(':');\n const qualName = i < 0 ? ['', name] : name.split(':');\n let prefix = qualName[0];\n let local = qualName[1];\n // <x \"xmlns\"=\"http://foo\">\n if (attribute && name === 'xmlns') {\n prefix = 'xmlns';\n local = '';\n }\n return { prefix, local };\n }\n write(chunk) {\n if (this.error) {\n throw this.error;\n }\n if (this.closed) {\n return this.errorFunction('Cannot write after close. Assign an onready handler.');\n }\n if (chunk === null) {\n return this.end();\n }\n if (typeof chunk === 'object') {\n chunk = chunk.toString();\n }\n let i = 0;\n let c;\n while (true) {\n c = SAX.charAt(chunk, i++);\n this.c = c;\n if (!c) {\n break;\n }\n if (this.trackPosition) {\n this.position++;\n if (c === '\\n') {\n this.line++;\n this.column = 0;\n }\n else {\n this.column++;\n }\n }\n switch (this.state) {\n case this.S.BEGIN:\n this.state = this.S.BEGIN_WHITESPACE;\n if (c === '\\uFEFF') {\n continue;\n }\n this.beginWhiteSpace(c);\n continue;\n case this.S.BEGIN_WHITESPACE:\n this.beginWhiteSpace(c);\n continue;\n case this.S.TEXT:\n if (this.sawRoot && !this.closedRoot) {\n const starti = i - 1;\n while (c && c !== '<' && c !== '&') {\n c = SAX.charAt(chunk, i++);\n if (c && this.trackPosition) {\n this.position++;\n if (c === '\\n') {\n this.line++;\n this.column = 0;\n }\n else {\n this.column++;\n }\n }\n }\n this.textNode += chunk.substring(starti, i - 1);\n }\n if (c === '<' && !(this.sawRoot && this.closedRoot && !this.strict)) {\n this.state = this.S.OPEN_WAKA;\n this.startTagPosition = this.position;\n }\n else {\n if (!SAX.isWhitespace(c) && (!this.sawRoot || this.closedRoot)) {\n this.strictFail('Text data outside of root node.');\n }\n if (c === '&') {\n this.state = this.S.TEXT_ENTITY;\n }\n else {\n this.textNode += c;\n }\n }\n continue;\n case this.S.SCRIPT:\n // only non-strict\n if (c === '<') {\n this.state = this.S.SCRIPT_ENDING;\n }\n else {\n this.script += c;\n }\n continue;\n case this.S.SCRIPT_ENDING:\n if (c === '/') {\n this.state = this.S.CLOSE_TAG;\n }\n else {\n this.script += `<${c}`;\n this.state = this.S.SCRIPT;\n }\n continue;\n case this.S.OPEN_WAKA:\n // either a /, ?, !, or text is coming next.\n if (c === '!') {\n this.state = this.S.SGML_DECL;\n this.sgmlDecl = '';\n }\n else if (SAX.isWhitespace(c)) {\n // wait for it...\n }\n else if (SAX.isMatch(nameStart, c)) {\n this.state = this.S.OPEN_TAG;\n this.tagName = c;\n }\n else if (c === '/') {\n this.state = this.S.CLOSE_TAG;\n this.tagName = '';\n }\n else if (c === '?') {\n this.state = this.S.PROC_INST;\n this.procInstName = this.procInstBody = '';\n }\n else {\n this.strictFail('Unencoded <');\n // if there was some whitespace, then add that in.\n if (this.startTagPosition + 1 < this.position) {\n const pad = this.position - this.startTagPosition;\n c = new Array(pad).join(' ') + c;\n }\n this.textNode += `<${c}`;\n this.state = this.S.TEXT;\n }\n continue;\n case this.S.SGML_DECL:\n if ((this.sgmlDecl + c).toUpperCase() === this.CDATA) {\n this.emitNode('onopencdata');\n this.state = this.S.CDATA;\n this.sgmlDecl = '';\n this.cdata = '';\n }\n else if (this.sgmlDecl + c === '--') {\n this.state = this.S.COMMENT;\n this.comment = '';\n this.sgmlDecl = '';\n }\n else if ((this.sgmlDecl + c).toUpperCase() === this.DOCTYPE) {\n this.state = this.S.DOCTYPE;\n if (this.doctype || this.sawRoot) {\n this.strictFail('Inappropriately located doctype declaration');\n }\n this.doctype = '';\n this.sgmlDecl = '';\n }\n else if (c === '>') {\n this.emitNode('onsgmldeclaration', this.sgmlDecl);\n this.sgmlDecl = '';\n this.state = this.S.TEXT;\n }\n else if (SAX.isQuote(c)) {\n this.state = this.S.SGML_DECL_QUOTED;\n this.sgmlDecl += c;\n }\n else {\n this.sgmlDecl += c;\n }\n continue;\n case this.S.SGML_DECL_QUOTED:\n if (c === this.q) {\n this.state = this.S.SGML_DECL;\n this.q = '';\n }\n this.sgmlDecl += c;\n continue;\n case this.S.DOCTYPE:\n if (c === '>') {\n this.state = this.S.TEXT;\n this.emitNode('ondoctype', this.doctype);\n this.doctype = true; // just remember that we saw it.\n }\n else {\n this.doctype += c;\n if (c === '[') {\n this.state = this.S.DOCTYPE_DTD;\n }\n else if (SAX.isQuote(c)) {\n this.state = this.S.DOCTYPE_QUOTED;\n this.q = c;\n }\n }\n continue;\n case this.S.DOCTYPE_QUOTED:\n this.doctype += c;\n if (c === this.q) {\n this.q = '';\n this.state = this.S.DOCTYPE;\n }\n continue;\n case this.S.DOCTYPE_DTD:\n this.doctype += c;\n if (c === ']') {\n this.state = this.S.DOCTYPE;\n }\n else if (SAX.isQuote(c)) {\n this.state = this.S.DOCTYPE_DTD_QUOTED;\n this.q = c;\n }\n continue;\n case this.S.DOCTYPE_DTD_QUOTED:\n this.doctype += c;\n if (c === this.q) {\n this.state = this.S.DOCTYPE_DTD;\n this.q = '';\n }\n continue;\n case this.S.COMMENT:\n if (c === '-') {\n this.state = this.S.COMMENT_ENDING;\n }\n else {\n this.comment += c;\n }\n continue;\n case this.S.COMMENT_ENDING:\n if (c === '-') {\n this.state = this.S.COMMENT_ENDED;\n this.comment = this.textApplyOptions(this.comment);\n if (this.comment) {\n this.emitNode('oncomment', this.comment);\n }\n this.comment = '';\n }\n else {\n this.comment += `-${c}`;\n this.state = this.S.COMMENT;\n }\n continue;\n case this.S.COMMENT_ENDED:\n if (c !== '>') {\n this.strictFail('Malformed comment');\n // allow <!-- blah -- bloo --> in non-strict mode,\n // which is a comment of \" blah -- bloo \"\n this.comment += `--${c}`;\n this.state = this.S.COMMENT;\n }\n else {\n this.state = this.S.TEXT;\n }\n continue;\n case this.S.CDATA:\n if (c === ']') {\n this.state = this.S.CDATA_ENDING;\n }\n else {\n this.cdata += c;\n }\n continue;\n case this.S.CDATA_ENDING:\n if (c === ']') {\n this.state = this.S.CDATA_ENDING_2;\n }\n else {\n this.cdata += `]${c}`;\n this.state = this.S.CDATA;\n }\n continue;\n case this.S.CDATA_ENDING_2:\n if (c === '>') {\n if (this.cdata) {\n this.emitNode('oncdata', this.cdata);\n }\n this.emitNode('onclosecdata');\n this.cdata = '';\n this.state = this.S.TEXT;\n }\n else if (c === ']') {\n this.cdata += ']';\n }\n else {\n this.cdata += `]]${c}`;\n this.state = this.S.CDATA;\n }\n continue;\n case this.S.PROC_INST:\n if (c === '?') {\n this.state = this.S.PROC_INST_ENDING;\n }\n else if (SAX.isWhitespace(c)) {\n this.state = this.S.PROC_INST_BODY;\n }\n else {\n this.procInstName += c;\n }\n continue;\n case this.S.PROC_INST_BODY:\n if (!this.procInstBody && SAX.isWhitespace(c)) {\n continue;\n }\n else if (c === '?') {\n this.state = this.S.PROC_INST_ENDING;\n }\n else {\n this.procInstBody += c;\n }\n continue;\n case this.S.PROC_INST_ENDING:\n if (c === '>') {\n this.emitNode('onprocessinginstruction', {\n name: this.procInstName,\n body: this.procInstBody\n });\n this.procInstName = this.procInstBody = '';\n this.state = this.S.TEXT;\n }\n else {\n this.procInstBody += `?${c}`;\n this.state = this.S.PROC_INST_BODY;\n }\n continue;\n case this.S.OPEN_TAG:\n if (SAX.isMatch(nameBody, c)) {\n this.tagName += c;\n }\n else {\n this.newTag();\n if (c === '>') {\n this.openTag();\n }\n else if (c === '/') {\n this.state = this.S.OPEN_TAG_SLASH;\n }\n else {\n if (!SAX.isWhitespace(c)) {\n this.strictFail('Invalid character in tag name');\n }\n this.state = this.S.ATTRIB;\n }\n }\n continue;\n case this.S.OPEN_TAG_SLASH:\n if (c === '>') {\n this.openTag(true);\n this.closeTag();\n }\n else {\n this.strictFail('Forward-slash in opening tag not followed by >');\n this.state = this.S.ATTRIB;\n }\n continue;\n case this.S.ATTRIB:\n // haven't read the attribute name yet.\n if (SAX.isWhitespace(c)) {\n continue;\n }\n else if (c === '>') {\n this.openTag();\n }\n else if (c === '/') {\n this.state = this.S.OPEN_TAG_SLASH;\n }\n else if (SAX.isMatch(nameStart, c)) {\n this.attribName = c;\n this.attribValue = '';\n this.state = this.S.ATTRIB_NAME;\n }\n else {\n this.strictFail('Invalid attribute name');\n }\n continue;\n case this.S.ATTRIB_NAME:\n if (c === '=') {\n this.state = this.S.ATTRIB_VALUE;\n }\n else if (c === '>') {\n this.strictFail('Attribute without value');\n this.attribValue = this.attribName;\n this.attrib();\n this.openTag();\n }\n else if (SAX.isWhitespace(c)) {\n this.state = this.S.ATTRIB_NAME_SAW_WHITE;\n }\n else if (SAX.isMatch(nameBody, c)) {\n this.attribName += c;\n }\n else {\n this.strictFail('Invalid attribute name');\n }\n continue;\n case this.S.ATTRIB_NAME_SAW_WHITE:\n if (c === '=') {\n this.state = this.S.ATTRIB_VALUE;\n }\n else if (SAX.isWhitespace(c)) {\n continue;\n }\n else {\n this.strictFail('Attribute without value');\n this.tag.attributes[this.attribName] = '';\n this.attribValue = '';\n this.emitNode('onattribute', {\n name: this.attribName,\n value: ''\n });\n this.attribName = '';\n if (c === '>') {\n this.openTag();\n }\n else if (SAX.isMatch(nameStart, c)) {\n this.attribName = c;\n this.state = this.S.ATTRIB_NAME;\n }\n else {\n this.strictFail('Invalid attribute name');\n this.state = this.S.ATTRIB;\n }\n }\n continue;\n case this.S.ATTRIB_VALUE:\n if (SAX.isWhitespace(c)) {\n continue;\n }\n else if (SAX.isQuote(c)) {\n this.q = c;\n this.state = this.S.ATTRIB_VALUE_QUOTED;\n }\n else {\n this.strictFail('Unquoted attribute value');\n this.state = this.S.ATTRIB_VALUE_UNQUOTED;\n this.attribValue = c;\n }\n continue;\n case this.S.ATTRIB_VALUE_QUOTED:\n if (c !== this.q) {\n if (c === '&') {\n this.state = this.S.ATTRIB_VALUE_ENTITY_Q;\n }\n else {\n this.attribValue += c;\n }\n continue;\n }\n this.attrib();\n this.q = '';\n this.state = this.S.ATTRIB_VALUE_CLOSED;\n continue;\n case this.S.ATTRIB_VALUE_CLOSED:\n if (SAX.isWhitespace(c)) {\n this.state = this.S.ATTRIB;\n }\n else if (c === '>') {\n this.openTag();\n }\n else if (c === '/') {\n this.state = this.S.OPEN_TAG_SLASH;\n }\n else if (SAX.isMatch(nameStart, c)) {\n this.strictFail('No whitespace between attributes');\n this.attribName = c;\n this.attribValue = '';\n this.state = this.S.ATTRIB_NAME;\n }\n else {\n this.strictFail('Invalid attribute name');\n }\n continue;\n case this.S.ATTRIB_VALUE_UNQUOTED:\n if (!SAX.isAttribEnd(c)) {\n if (c === '&') {\n this.state = this.S.ATTRIB_VALUE_ENTITY_U;\n }\n else {\n this.attribValue += c;\n }\n continue;\n }\n this.attrib();\n if (c === '>') {\n this.openTag();\n }\n else {\n this.state = this.S.ATTRIB;\n }\n continue;\n case this.S.CLOSE_TAG:\n if (!this.tagName) {\n if (SAX.isWhitespace(c)) {\n continue;\n }\n else if (SAX.notMatch(nameStart, c)) {\n if (this.script) {\n this.script += `</${c}`;\n this.state = this.S.SCRIPT;\n }\n else {\n this.strictFail('Invalid tagname in closing tag.');\n }\n }\n else {\n this.tagName = c;\n }\n }\n else if (c === '>') {\n this.closeTag();\n }\n else if (SAX.isMatch(nameBody, c)) {\n this.tagName += c;\n }\n else if (this.script) {\n this.script += `</${this.tagName}`;\n this.tagName = '';\n this.state = this.S.SCRIPT;\n }\n else {\n if (!SAX.isWhitespace(c)) {\n this.strictFail('Invalid tagname in closing tag');\n }\n this.state = this.S.CLOSE_TAG_SAW_WHITE;\n }\n continue;\n case this.S.CLOSE_TAG_SAW_WHITE:\n if (SAX.isWhitespace(c)) {\n continue;\n }\n if (c === '>') {\n this.closeTag();\n }\n else {\n this.strictFail('Invalid characters in closing tag');\n }\n continue;\n case this.S.TEXT_ENTITY:\n case this.S.ATTRIB_VALUE_ENTITY_Q:\n case this.S.ATTRIB_VALUE_ENTITY_U:\n let returnState;\n let buffer;\n switch (this.state) {\n case this.S.TEXT_ENTITY:\n returnState = this.S.TEXT;\n buffer = 'textNode';\n break;\n case this.S.ATTRIB_VALUE_ENTITY_Q:\n returnState = this.S.ATTRIB_VALUE_QUOTED;\n buffer = 'attribValue';\n break;\n case this.S.ATTRIB_VALUE_ENTITY_U:\n returnState = this.S.ATTRIB_VALUE_UNQUOTED;\n buffer = 'attribValue';\n break;\n default:\n throw new Error(`Unknown state: ${this.state}`);\n }\n if (c === ';') {\n this[buffer] += this.parseEntity();\n this.entity = '';\n this.state = returnState;\n }\n else if (SAX.isMatch(this.entity.length ? entityBody : entityStart, c)) {\n this.entity += c;\n }\n else {\n this.strictFail('Invalid character in entity name');\n this[buffer] += `&${this.entity}${c}`;\n this.entity = '';\n this.state = returnState;\n }\n continue;\n default:\n throw new Error(`Unknown state: ${this.state}`);\n }\n } // while\n if (this.position >= this.bufferCheckPosition) {\n this.checkBufferLength();\n }\n return this;\n }\n emit(event, data) {\n if (this.events.hasOwnProperty(event)) {\n const eventName = event.replace(/^on/, '');\n this.events[event](data, eventName, this);\n }\n }\n clearBuffers() {\n for (let i = 0, l = this.BUFFERS.length; i < l; i++) {\n this[this[i]] = '';\n }\n }\n flushBuffers() {\n this.closeText();\n if (this.cdata !== '') {\n this.emitNode('oncdata', this.cdata);\n this.cdata = '';\n }\n if (this.script !== '') {\n this.emitNode('onscript', this.script);\n this.script = '';\n }\n }\n end() {\n if (this.sawRoot && !this.closedRoot)\n this.strictFail('Unclosed root tag');\n if (this.state !== this.S.BEGIN &&\n this.state !== this.S.BEGIN_WHITESPACE &&\n this.state !== this.S.TEXT) {\n this.errorFunction('Unexpected end');\n }\n this.closeText();\n this.c = '';\n this.closed = true;\n this.emit('onend');\n return new SAXParser(this.opt);\n }\n errorFunction(er) {\n this.closeText();\n if (this.trackPosition) {\n er += `\\nLine: ${this.line}\\nColumn: ${this.column}\\nChar: ${this.c}`;\n }\n const error = new Error(er);\n this.error = error;\n this.emit('onerror', error);\n return this;\n }\n attrib() {\n if (!this.strict) {\n this.attribName = this.attribName[this.looseCase]();\n }\n if (this.attribList.indexOf(this.attribName) !== -1 ||\n this.tag.attributes.hasOwnProperty(this.attribName)) {\n this.attribName = this.attribValue = '';\n return;\n }\n if (this.opt.xmlns) {\n const qn = SAX.qname(this.attribName, true);\n const prefix = qn.prefix;\n const local = qn.local;\n if (prefix === 'xmlns') {\n // namespace binding attribute. push the binding into scope\n if (local === 'xml' && this.attribValue !== this.XML_NAMESPACE) {\n this.strictFail(`xml: prefix must be bound to ${this.XML_NAMESPACE}\\n` + `Actual: ${this.attribValue}`);\n }\n else if (local === 'xmlns' && this.attribValue !== this.XMLNS_NAMESPACE) {\n this.strictFail(`xmlns: prefix must be bound to ${this.XMLNS_NAMESPACE}\\n` +\n `Actual: ${this.attribValue}`);\n }\n else {\n const tag = this.tag;\n const parent = this.tags[this.tags.length - 1] || this;\n if (tag.ns === parent.ns) {\n tag.ns = Object.create(parent.ns);\n }\n tag.ns[local] = this.attribValue;\n }\n }\n // defer onattribute events until all attributes have been seen\n // so any new bindings can take effect. preserve attribute order\n // so deferred events can be emitted in document order\n this.attribList.push([this.attribName, this.attribValue]);\n }\n else {\n // in non-xmlns mode, we can emit the event right away\n this.tag.attributes[this.attribName] = this.attribValue;\n this.emitNode('onattribute', {\n name: this.attribName,\n value: this.attribValue\n });\n }\n this.attribName = this.attribValue = '';\n }\n newTag() {\n if (!this.strict)\n this.tagName = this.tagName[this.looseCase]();\n const parent = this.tags[this.tags.length - 1] || this;\n const tag = (this.tag = { name: this.tagName, attributes: {} });\n // will be overridden if tag contains an xmlns=\"foo\" or xmlns:foo=\"bar\"\n if (this.opt.xmlns) {\n tag.ns = parent.ns;\n }\n this.attribList.length = 0;\n this.emitNode('onopentagstart', tag);\n }\n parseEntity() {\n let entity = this.entity;\n const entityLC = entity.toLowerCase();\n let num = NaN;\n let numStr = '';\n if (this.ENTITIES[entity]) {\n return this.ENTITIES[entity];\n }\n if (this.ENTITIES[entityLC]) {\n return this.ENTITIES[entityLC];\n }\n entity = entityLC;\n if (entity.charAt(0) === '#') {\n if (entity.charAt(1) === 'x') {\n entity = entity.slice(2);\n // TODO: remove tslint:disable\n // tslint:disable-next-line\n num = parseInt(entity, 16);\n numStr = num.toString(16);\n }\n else {\n entity = entity.slice(1);\n // TODO: remove tslint:disable\n // tslint:disable-next-line\n num = parseInt(entity, 10);\n numStr = num.toString(10);\n }\n }\n entity = entity.replace(/^0+/, '');\n if (isNaN(num) || numStr.toLowerCase() !== entity) {\n this.strictFail('Invalid character entity');\n return `&${this.entity};`;\n }\n return String.fromCodePoint(num);\n }\n beginWhiteSpace(c) {\n if (c === '<') {\n this.state = this.S.OPEN_WAKA;\n this.startTagPosition = this.position;\n }\n else if (!SAX.isWhitespace(c)) {\n // have to process this as a text node.\n // weird, but happens.\n this.strictFail('Non-whitespace before first tag.');\n this.textNode = c;\n this.state = this.S.TEXT;\n }\n else {\n }\n }\n strictFail(message) {\n if (typeof this !== 'object' || !(this instanceof SAXParser)) {\n throw new Error('bad call to strictFail');\n }\n if (this.strict) {\n this.errorFunction(message);\n }\n }\n textApplyOptions(text) {\n if (this.opt.trim)\n text = text.trim();\n if (this.opt.normalize)\n text = text.replace(/\\s+/g, ' ');\n return text;\n }\n emitNode(nodeType, data) {\n if (this.textNode)\n this.closeText();\n this.emit(nodeType, data);\n }\n closeText() {\n this.textNode = this.textApplyOptions(this.textNode);\n // TODO: figure out why this.textNode can be \"\" and \"undefined\"\n if (this.textNode !== undefined && this.textNode !== '' && this.textNode !== 'undefined') {\n this.emit('ontext', this.textNode);\n }\n this.textNode = '';\n }\n checkBufferLength() {\n const maxAllowed = Math.max(this.opt.MAX_BUFFER_LENGTH, 10);\n let maxActual = 0;\n for (let i = 0, l = this.BUFFERS.length; i < l; i++) {\n const len = this[this.BUFFERS[i]]?.length || 0;\n if (len > maxAllowed) {\n // Text/cdata nodes can get big, and since they're buffered,\n // we can get here under normal conditions.\n // Avoid issues by emitting the text node now,\n // so at least it won't get any bigger.\n switch (this.BUFFERS[i]) {\n case 'textNode':\n this.closeText();\n break;\n case 'cdata':\n this.emitNode('oncdata', this.cdata);\n this.cdata = '';\n break;\n case 'script':\n this.emitNode('onscript', this.script);\n this.script = '';\n break;\n default:\n this.errorFunction(`Max buffer length exceeded: ${this.BUFFERS[i]}`);\n }\n }\n maxActual = Math.max(maxActual, len);\n }\n // schedule the next check for the earliest possible buffer overrun.\n const m = this.opt.MAX_BUFFER_LENGTH - maxActual;\n this.bufferCheckPosition = m + this.position;\n }\n openTag(selfClosing) {\n if (this.opt.xmlns) {\n // emit namespace binding events\n const tag = this.tag;\n // add namespace info to tag\n const qn = SAX.qname(this.tagName);\n tag.prefix = qn.prefix;\n tag.local = qn.local;\n tag.uri = tag.ns[qn.prefix] || '';\n if (tag.prefix && !tag.uri) {\n this.strictFail(`Unbound namespace prefix: ${JSON.stringify(this.tagName)}`);\n tag.uri = qn.prefix;\n }\n const parent = this.tags[this.tags.length - 1] || this;\n if (tag.ns && parent.ns !== tag.ns) {\n const that = this;\n Object.keys(tag.ns).forEach((p) => {\n that.emitNode('onopennamespace', {\n prefix: p,\n uri: tag.ns[p]\n });\n });\n }\n // handle deferred onattribute events\n // Note: do not apply default ns to attributes:\n // http://www.w3.org/TR/REC-xml-names/#defaulting\n for (let i = 0, l = this.attribList.length; i < l; i++) {\n const nv = this.attribList[i];\n const name = nv[0];\n const value = nv[1];\n const qualName = SAX.qname(name, true);\n const prefix = qualName.prefix;\n const local = qualName.local;\n const uri = prefix === '' ? '' : tag.ns[prefix] || '';\n const a = {\n name,\n value,\n prefix,\n local,\n uri\n };\n // if there's any attributes with an undefined namespace,\n // then fail on them now.\n if (prefix && prefix !== 'xmlns' && !uri) {\n this.strictFail(`Unbound namespace prefix: ${JSON.stringify(prefix)}`);\n a.uri = prefix;\n }\n this.tag.attributes[name] = a;\n this.emitNode('onattribute', a);\n }\n this.attribList.length = 0;\n }\n this.tag.isSelfClosing = Boolean(selfClosing);\n // process the tag\n this.sawRoot = true;\n this.tags.push(this.tag);\n this.emitNode('onopentag', this.tag);\n if (!selfClosing) {\n // special case for <script> in non-strict mode.\n if (!this.noscript && this.tagName.toLowerCase() === 'script') {\n this.state = this.S.SCRIPT;\n }\n else {\n this.state = this.S.TEXT;\n }\n this.tag = null;\n this.tagName = '';\n }\n this.attribName = this.attribValue = '';\n this.attribList.length = 0;\n }\n closeTag() {\n if (!this.tagName) {\n this.strictFail('Weird empty close tag.');\n this.textNode += '</>';\n this.state = this.S.TEXT;\n return;\n }\n if (this.script) {\n if (this.tagName !== 'script') {\n this.script += `</${this.tagName}>`;\n this.tagName = '';\n this.state = this.S.SCRIPT;\n return;\n }\n this.emitNode('onscript', this.script);\n this.script = '';\n }\n // first make sure that the closing tag actually exists.\n // <a><b></c></b></a> will close everything, otherwise.\n let t = this.tags.length;\n let tagName = this.tagName;\n if (!this.strict) {\n tagName = tagName[this.looseCase]();\n }\n while (t--) {\n const close = this.tags[t];\n if (close.name !== tagName) {\n // fail the first time in strict mode\n this.strictFail('Unexpected close tag');\n }\n else {\n break;\n }\n }\n // didn't find it. we already failed for strict, so just abort.\n if (t < 0) {\n this.strictFail(`Unmatched closing tag: ${this.tagName}`);\n this.textNode += `</${this.tagName}>`;\n this.state = this.S.TEXT;\n return;\n }\n this.tagName = tagName;\n let s = this.tags.length;\n while (s-- > t) {\n const tag = (this.tag = this.tags.pop());\n this.tagName = this.tag.name;\n this.emitNode('onclosetag', this.tagName);\n const x = {};\n for (const i in tag.ns) {\n if (tag.ns.hasOwnProperty(i)) {\n x[i] = tag.ns[i];\n }\n }\n const parent = this.tags[this.tags.length - 1] || this;\n if (this.opt.xmlns && tag.ns !== parent.ns) {\n // remove namespace bindings introduced by tag\n const that = this;\n Object.keys(tag.ns).forEach((p) => {\n const n = tag.ns[p];\n that.emitNode('onclosenamespace', { prefix: p, uri: n });\n });\n }\n }\n if (t === 0)\n this.closedRoot = true;\n this.tagName = this.attribValue = this.attribName = '';\n this.attribList.length = 0;\n this.state = this.S.TEXT;\n }\n}\n/**\n *\n * @todo Weird inheritance, with some variables initialized in subclass\n */\nexport class SAXParser extends SAX {\n static ENTITIES = ENTITIES;\n opt = DEFAULT_SAX_PARSER_OPTIONS;\n events = DEFAULT_SAX_EVENTS;\n constructor(opt) {\n super();\n this.clearBuffers();\n this.opt = opt = { ...this.opt, ...opt };\n this.events = { ...this.events, ...opt };\n this.q = this.c = '';\n this.opt.lowercase = this.opt.lowercase || this.opt.lowercasetags;\n this.bufferCheckPosition = this.opt.MAX_BUFFER_LENGTH;\n this.looseCase = this.opt.lowercase ? 'toLowerCase' : 'toUpperCase';\n this.tags = [];\n this.closed = this.closedRoot = this.sawRoot = false;\n this.tag = this.error = null;\n this.strict = Boolean(this.opt.strict);\n this.noscript = Boolean(this.opt.strict || this.opt.noscript);\n this.state = this.S.BEGIN;\n this.strictEntities = this.opt.strictEntities;\n this.ENTITIES = this.strictEntities\n ? Object.create(this.XML_ENTITIES)\n : Object.create(this.ENTITIES);\n this.attribList = [];\n // namespaces form a prototype chain.\n // it always points at the current tag,\n // which protos to its parent tag.\n if (this.opt.xmlns) {\n this.ns = Object.create(this.rootNS);\n }\n // mostly just for error reporting\n this.trackPosition = this.opt.position !== false;\n if (this.trackPosition) {\n this.position = this.line = this.column = 0;\n }\n this.emit('onready');\n }\n resume() {\n this.error = null;\n return this;\n }\n close() {\n return this.write(null);\n }\n flush() {\n this.flushBuffers();\n }\n}\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n/**\n * Uncapitalize first letter of a string\n * @param str\n * @returns\n */\nexport function uncapitalize(str) {\n return typeof str === 'string' ? str.charAt(0).toLowerCase() + str.slice(1) : str;\n}\n/**\n * Recursively uncapitalize all keys in a nested object\n * @param object\n * @returns\n */\nexport function uncapitalizeKeys(object) {\n if (Array.isArray(object)) {\n return object.map((element) => uncapitalizeKeys(element));\n }\n if (object && typeof object === 'object') {\n const newObject = {};\n for (const [key, value] of Object.entries(object)) {\n newObject[uncapitalize(key)] = uncapitalizeKeys(value);\n }\n return newObject;\n }\n return object;\n}\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { StreamingXMLParser } from \"./streaming-xml-parser.js\";\nimport { uncapitalizeKeys } from \"../xml-utils/uncapitalize.js\";\nimport { XMLParser as FastXMLParser } from 'fast-xml-parser';\nexport function parseXMLSync(text, options) {\n if (options?._parser && options._parser !== 'fast-xml-parser') {\n throw new Error(options?._parser);\n }\n const fastXMLOptions = {\n // Default FastXML options\n // https://github.com/NaturalIntelligence/fast-xml-parser/blob/master/docs/v4/2.XMLparseOptions.md#allowbooleanattributes\n allowBooleanAttributes: true,\n // https://github.com/NaturalIntelligence/fast-xml-parser/blob/master/docs/v4/2.XMLparseOptions.md#ignoredeclaration\n ignoreDeclaration: true,\n // https://github.com/NaturalIntelligence/fast-xml-parser/blob/master/docs/v4/2.XMLparseOptions.md#removensprefix\n removeNSPrefix: options?.removeNSPrefix,\n // https://github.com/NaturalIntelligence/fast-xml-parser/blob/master/docs/v4/2.XMLparseOptions.md#textnodename\n textNodeName: options?.textNodeName,\n // Let's application specify keys that are always arrays\n isArray: (name, jpath, isLeafNode, isAttribute) => {\n const array = Boolean(options?.arrayPaths?.some((path) => jpath === path));\n return array;\n },\n // Application overrides\n ...options?._fastXML\n };\n const xml = fastParseXML(text, fastXMLOptions);\n // Note - could be done with FastXML tag processing\n return options?.uncapitalizeKeys ? uncapitalizeKeys(xml) : xml;\n}\nexport function fastParseXML(text, options) {\n const parser = new FastXMLParser({\n ignoreAttributes: false,\n attributeNamePrefix: '',\n ...options\n });\n const parsedXML = parser.parse(text);\n return parsedXML;\n}\n/**\n * @todo Build a streaming XML parser based on sax-js\n * @param text\n * @param options\n * @returns\n */\nexport function parseXMLInBatches(text, options = {}) {\n const parser = new StreamingXMLParser({\n ...options,\n strict: true\n });\n parser.write(text);\n parser.close();\n return parser.result;\n}\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { parseXMLSync } from \"./lib/parsers/parse-xml.js\";\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof \"4.3.1\" !== 'undefined' ? \"4.3.1\" : 'latest';\n/**\n * Loader for XML files\n */\nexport const XMLLoader = {\n dataType: null,\n batchType: null,\n name: 'XML',\n id: 'xml',\n module: 'xml',\n version: VERSION,\n worker: false,\n extensions: ['xml'],\n mimeTypes: ['application/xml', 'text/xml'],\n testText: testXMLFile,\n options: {\n xml: {\n _parser: 'fast-xml-parser',\n uncapitalizeKeys: false,\n removeNSPrefix: false,\n textNodeName: 'value',\n arrayPaths: []\n }\n },\n parse: async (arrayBuffer, options) => parseXMLSync(new TextDecoder().decode(arrayBuffer), {\n ...XMLLoader.options.xml,\n ...options?.xml\n }),\n parseTextSync: (text, options) => parseXMLSync(text, { ...XMLLoader.options.xml, ...options?.xml })\n};\nfunction testXMLFile(text) {\n // TODO - There could be space first.\n return text.startsWith('<?xml');\n}\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { mergeLoaderOptions } from '@loaders.gl/loader-utils';\nimport { XMLLoader } from \"./xml-loader.js\";\n/**\n * Loader for HTML files\n * Essentially a copy of the XMLLoader with different mime types, file extensions and content tests.\n * This split enables applications can control whether they want HTML responses to be parsed by the XML loader or not.\n * This loader does not have any additional understanding of the structure of HTML or the document.\n */\nexport const HTMLLoader = {\n ...XMLLoader,\n name: 'HTML',\n id: 'html',\n extensions: ['html', 'htm'],\n mimeTypes: ['text/html'],\n testText: testHTMLFile,\n parse: async (arrayBuffer, options) => parseTextSync(new TextDecoder().decode(arrayBuffer), options),\n parseTextSync: (text, options) => parseTextSync(text, options)\n};\nfunction testHTMLFile(text) {\n // TODO - There could be space first.\n return text.startsWith('<html');\n}\nfunction parseTextSync(text, options) {\n // fast-xml-parser can recognize HTML entities\n // https://github.com/NaturalIntelligence/fast-xml-parser/blob/master/docs/v4/2.XMLparseOptions.md#htmlentities\n // https://github.com/NaturalIntelligence/fast-xml-parser/blob/master/docs/v4/5.Entities.md\n options = mergeLoaderOptions(options, {\n xml: {\n _parser: 'fast-xml-parser',\n _fastXML: {\n htmlEntities: true\n }\n }\n });\n return XMLLoader.parseTextSync?.(text, options);\n}\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n// TODO - these utilities could be moved to the XML parser.\n// uncapitalizeKeys could be an XMLLoader option\n/**\n * Extracts a value or array and always return an array\n * Useful since XML parses to object instead of array when only a single value is provided\n */\nexport function convertXMLValueToArray(xmlValue) {\n if (Array.isArray(xmlValue)) {\n return xmlValue;\n }\n if (xmlValue && typeof xmlValue === 'object' && xmlValue['0']) {\n // Error this is an objectified array\n }\n if (xmlValue) {\n return [xmlValue];\n }\n return [];\n}\n/**\n * Mutates a field in place, converting it to array\n * Useful since XML parses to object instead of array when only a single value is provided\n */\nexport function convertXMLFieldToArrayInPlace(xml, key) {\n xml[key] = convertXMLValueToArray(xml[key]);\n}\n"],
|
|
4
|
+
"sourcesContent": ["// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nexport { XMLLoader } from \"./xml-loader.js\";\nexport { HTMLLoader } from \"./html-loader.js\";\nexport { SAXParser as SAXParser } from \"./sax-ts/sax.js\";\n// Utilities\nexport { convertXMLValueToArray, convertXMLFieldToArrayInPlace } from \"./lib/xml-utils/xml-utils.js\";\n// Experimental\nexport { uncapitalize as _uncapitalize, uncapitalizeKeys as _uncapitalizeKeys } from \"./lib/xml-utils/uncapitalize.js\";\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nconst DEFAULT_SAX_EVENTS = {\n ontext: () => { },\n onprocessinginstruction: () => { },\n onsgmldeclaration: () => { },\n ondoctype: () => { },\n oncomment: () => { },\n onopentagstart: () => { },\n onattribute: () => { },\n onopentag: () => { },\n onclosetag: () => { },\n onopencdata: () => { },\n oncdata: () => { },\n onclosecdata: () => { },\n onerror: () => { },\n onend: () => { },\n onready: () => { },\n onscript: () => { },\n onopennamespace: () => { },\n onclosenamespace: () => { }\n};\nconst DEFAULT_SAX_PARSER_OPTIONS = {\n ...DEFAULT_SAX_EVENTS,\n strict: false,\n MAX_BUFFER_LENGTH: 64 * 1024,\n lowercase: false,\n lowercasetags: false,\n noscript: false,\n strictEntities: false,\n xmlns: undefined,\n position: undefined,\n trim: undefined,\n normalize: undefined\n};\nconst EVENTS = [\n 'text',\n 'processinginstruction',\n 'sgmldeclaration',\n 'doctype',\n 'comment',\n 'opentagstart',\n 'attribute',\n 'opentag',\n 'closetag',\n 'opencdata',\n 'cdata',\n 'closecdata',\n 'error',\n 'end',\n 'ready',\n 'script',\n 'opennamespace',\n 'closenamespace'\n];\nconst BUFFERS = [\n 'comment',\n 'sgmlDecl',\n 'textNode',\n 'tagName',\n 'doctype',\n 'procInstName',\n 'procInstBody',\n 'entity',\n 'attribName',\n 'attribValue',\n 'cdata',\n 'script'\n];\nconst nameStart = /[:_A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]/;\nconst nameBody = /[:_A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\u00B7\\u0300-\\u036F\\u203F-\\u2040.\\d-]/;\nconst entityStart = /[#:_A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]/;\nconst entityBody = /[#:_A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\u00B7\\u0300-\\u036F\\u203F-\\u2040.\\d-]/;\nexport const ENTITIES = {\n amp: '&',\n gt: '>',\n lt: '<',\n quot: '\"',\n apos: \"'\",\n AElig: 198,\n Aacute: 193,\n Acirc: 194,\n Agrave: 192,\n Aring: 197,\n Atilde: 195,\n Auml: 196,\n Ccedil: 199,\n ETH: 208,\n Eacute: 201,\n Ecirc: 202,\n Egrave: 200,\n Euml: 203,\n Iacute: 205,\n Icirc: 206,\n Igrave: 204,\n Iuml: 207,\n Ntilde: 209,\n Oacute: 211,\n Ocirc: 212,\n Ograve: 210,\n Oslash: 216,\n Otilde: 213,\n Ouml: 214,\n THORN: 222,\n Uacute: 218,\n Ucirc: 219,\n Ugrave: 217,\n Uuml: 220,\n Yacute: 221,\n aacute: 225,\n acirc: 226,\n aelig: 230,\n agrave: 224,\n aring: 229,\n atilde: 227,\n auml: 228,\n ccedil: 231,\n eacute: 233,\n ecirc: 234,\n egrave: 232,\n eth: 240,\n euml: 235,\n iacute: 237,\n icirc: 238,\n igrave: 236,\n iuml: 239,\n ntilde: 241,\n oacute: 243,\n ocirc: 244,\n ograve: 242,\n oslash: 248,\n otilde: 245,\n ouml: 246,\n szlig: 223,\n thorn: 254,\n uacute: 250,\n ucirc: 251,\n ugrave: 249,\n uuml: 252,\n yacute: 253,\n yuml: 255,\n copy: 169,\n reg: 174,\n nbsp: 160,\n iexcl: 161,\n cent: 162,\n pound: 163,\n curren: 164,\n yen: 165,\n brvbar: 166,\n sect: 167,\n uml: 168,\n ordf: 170,\n laquo: 171,\n not: 172,\n shy: 173,\n macr: 175,\n deg: 176,\n plusmn: 177,\n sup1: 185,\n sup2: 178,\n sup3: 179,\n acute: 180,\n micro: 181,\n para: 182,\n middot: 183,\n cedil: 184,\n ordm: 186,\n raquo: 187,\n frac14: 188,\n frac12: 189,\n frac34: 190,\n iquest: 191,\n times: 215,\n divide: 247,\n OElig: 338,\n oelig: 339,\n Scaron: 352,\n scaron: 353,\n Yuml: 376,\n fnof: 402,\n circ: 710,\n tilde: 732,\n Alpha: 913,\n Beta: 914,\n Gamma: 915,\n Delta: 916,\n Epsilon: 917,\n Zeta: 918,\n Eta: 919,\n Theta: 920,\n Iota: 921,\n Kappa: 922,\n Lambda: 923,\n Mu: 924,\n Nu: 925,\n Xi: 926,\n Omicron: 927,\n Pi: 928,\n Rho: 929,\n Sigma: 931,\n Tau: 932,\n Upsilon: 933,\n Phi: 934,\n Chi: 935,\n Psi: 936,\n Omega: 937,\n alpha: 945,\n beta: 946,\n gamma: 947,\n delta: 948,\n epsilon: 949,\n zeta: 950,\n eta: 951,\n theta: 952,\n iota: 953,\n kappa: 954,\n lambda: 955,\n mu: 956,\n nu: 957,\n xi: 958,\n omicron: 959,\n pi: 960,\n rho: 961,\n sigmaf: 962,\n sigma: 963,\n tau: 964,\n upsilon: 965,\n phi: 966,\n chi: 967,\n psi: 968,\n omega: 969,\n thetasym: 977,\n upsih: 978,\n piv: 982,\n ensp: 8194,\n emsp: 8195,\n thinsp: 8201,\n zwnj: 8204,\n zwj: 8205,\n lrm: 8206,\n rlm: 8207,\n ndash: 8211,\n mdash: 8212,\n lsquo: 8216,\n rsquo: 8217,\n sbquo: 8218,\n ldquo: 8220,\n rdquo: 8221,\n bdquo: 8222,\n dagger: 8224,\n Dagger: 8225,\n bull: 8226,\n hellip: 8230,\n permil: 8240,\n prime: 8242,\n Prime: 8243,\n lsaquo: 8249,\n rsaquo: 8250,\n oline: 8254,\n frasl: 8260,\n euro: 8364,\n image: 8465,\n weierp: 8472,\n real: 8476,\n trade: 8482,\n alefsym: 8501,\n larr: 8592,\n uarr: 8593,\n rarr: 8594,\n darr: 8595,\n harr: 8596,\n crarr: 8629,\n lArr: 8656,\n uArr: 8657,\n rArr: 8658,\n dArr: 8659,\n hArr: 8660,\n forall: 8704,\n part: 8706,\n exist: 8707,\n empty: 8709,\n nabla: 8711,\n isin: 8712,\n notin: 8713,\n ni: 8715,\n prod: 8719,\n sum: 8721,\n minus: 8722,\n lowast: 8727,\n radic: 8730,\n prop: 8733,\n infin: 8734,\n ang: 8736,\n and: 8743,\n or: 8744,\n cap: 8745,\n cup: 8746,\n int: 8747,\n there4: 8756,\n sim: 8764,\n cong: 8773,\n asymp: 8776,\n ne: 8800,\n equiv: 8801,\n le: 8804,\n ge: 8805,\n sub: 8834,\n sup: 8835,\n nsub: 8836,\n sube: 8838,\n supe: 8839,\n oplus: 8853,\n otimes: 8855,\n perp: 8869,\n sdot: 8901,\n lceil: 8968,\n rceil: 8969,\n lfloor: 8970,\n rfloor: 8971,\n lang: 9001,\n rang: 9002,\n loz: 9674,\n spades: 9824,\n clubs: 9827,\n hearts: 9829,\n diams: 9830\n};\nObject.keys(ENTITIES).forEach((key) => {\n const e = ENTITIES[key];\n ENTITIES[key] = typeof e === 'number' ? String.fromCharCode(e) : e;\n});\n/**\n * Internal helper class\n */\nclass SAX {\n EVENTS = EVENTS;\n ENTITIES = {\n // TODO: make it readonly, needed for entity-mega test\n // amp, gt, lt, quot and apos are resolved to strings instead of numerical\n // codes, IDK why\n ...ENTITIES\n };\n XML_ENTITIES = {\n amp: '&',\n gt: '>',\n lt: '<',\n quot: '\"',\n apos: \"'\"\n };\n S = 0;\n opt;\n trackPosition = false;\n column = 0;\n line = 0;\n c = '';\n error;\n q = '';\n bufferCheckPosition;\n closed = false;\n tags = [];\n looseCase = '';\n closedRoot = false;\n sawRoot = false;\n strict = false;\n tag;\n strictEntities;\n state;\n noscript = false;\n attribList = [];\n ns;\n position = 0;\n STATE = {\n BEGIN: this.S++, // leading byte order mark or whitespace\n BEGIN_WHITESPACE: this.S++, // leading whitespace\n TEXT: this.S++, // general stuff\n TEXT_ENTITY: this.S++, // & and such.\n OPEN_WAKA: this.S++, // <\n SGML_DECL: this.S++, // <!BLARG\n SGML_DECL_QUOTED: this.S++, // <!BLARG foo \"bar\n DOCTYPE: this.S++, // <!DOCTYPE\n DOCTYPE_QUOTED: this.S++, // <!DOCTYPE \"//blah\n DOCTYPE_DTD: this.S++, // <!DOCTYPE \"//blah\" [ ...\n DOCTYPE_DTD_QUOTED: this.S++, // <!DOCTYPE \"//blah\" [ \"foo\n COMMENT_STARTING: this.S++, // <!-\n COMMENT: this.S++, // <!--\n COMMENT_ENDING: this.S++, // <!-- blah -\n COMMENT_ENDED: this.S++, // <!-- blah --\n CDATA: this.S++, // <![CDATA[ something\n CDATA_ENDING: this.S++, // ]\n CDATA_ENDING_2: this.S++, // ]]\n PROC_INST: this.S++, // <?hi\n PROC_INST_BODY: this.S++, // <?hi there\n PROC_INST_ENDING: this.S++, // <?hi \"there\" ?\n OPEN_TAG: this.S++, // <strong\n OPEN_TAG_SLASH: this.S++, // <strong /\n ATTRIB: this.S++, // <a\n ATTRIB_NAME: this.S++, // <a foo\n ATTRIB_NAME_SAW_WHITE: this.S++, // <a foo _\n ATTRIB_VALUE: this.S++, // <a foo=\n ATTRIB_VALUE_QUOTED: this.S++, // <a foo=\"bar\n ATTRIB_VALUE_CLOSED: this.S++, // <a foo=\"bar\"\n ATTRIB_VALUE_UNQUOTED: this.S++, // <a foo=bar\n ATTRIB_VALUE_ENTITY_Q: this.S++, // <foo bar=\""\"\n ATTRIB_VALUE_ENTITY_U: this.S++, // <foo bar="\n CLOSE_TAG: this.S++, // </a\n CLOSE_TAG_SAW_WHITE: this.S++, // </a >\n SCRIPT: this.S++, // <script> ...\n SCRIPT_ENDING: this.S++ // <script> ... <\n };\n BUFFERS = BUFFERS;\n // private parser: (strict: boolean, opt: any) => SAXParser;\n CDATA = '[CDATA[';\n DOCTYPE = 'DOCTYPE';\n XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace';\n XMLNS_NAMESPACE = 'http://www.w3.org/2000/xmlns/';\n rootNS = {\n xml: this.XML_NAMESPACE,\n xmlns: this.XMLNS_NAMESPACE\n };\n comment;\n sgmlDecl;\n textNode = '';\n tagName;\n doctype;\n procInstName;\n procInstBody;\n entity = '';\n attribName;\n attribValue;\n cdata = '';\n script = '';\n startTagPosition = 0;\n constructor() {\n this.S = 0;\n for (const s in this.STATE) {\n if (this.STATE.hasOwnProperty(s)) {\n this.STATE[this.STATE[s]] = s;\n }\n }\n // shorthand\n this.S = this.STATE;\n }\n static charAt(chunk, i) {\n let result = '';\n if (i < chunk.length) {\n result = chunk.charAt(i);\n }\n return result;\n }\n static isWhitespace(c) {\n return c === ' ' || c === '\\n' || c === '\\r' || c === '\\t';\n }\n static isQuote(c) {\n return c === '\"' || c === \"'\";\n }\n static isAttribEnd(c) {\n return c === '>' || SAX.isWhitespace(c);\n }\n static isMatch(regex, c) {\n return regex.test(c);\n }\n static notMatch(regex, c) {\n return !SAX.isMatch(regex, c);\n }\n static qname(name, attribute) {\n const i = name.indexOf(':');\n const qualName = i < 0 ? ['', name] : name.split(':');\n let prefix = qualName[0];\n let local = qualName[1];\n // <x \"xmlns\"=\"http://foo\">\n if (attribute && name === 'xmlns') {\n prefix = 'xmlns';\n local = '';\n }\n return { prefix, local };\n }\n write(chunk) {\n if (this.error) {\n throw this.error;\n }\n if (this.closed) {\n return this.errorFunction('Cannot write after close. Assign an onready handler.');\n }\n if (chunk === null) {\n return this.end();\n }\n if (typeof chunk === 'object') {\n chunk = chunk.toString();\n }\n let i = 0;\n let c;\n while (true) {\n c = SAX.charAt(chunk, i++);\n this.c = c;\n if (!c) {\n break;\n }\n if (this.trackPosition) {\n this.position++;\n if (c === '\\n') {\n this.line++;\n this.column = 0;\n }\n else {\n this.column++;\n }\n }\n switch (this.state) {\n case this.S.BEGIN:\n this.state = this.S.BEGIN_WHITESPACE;\n if (c === '\\uFEFF') {\n continue;\n }\n this.beginWhiteSpace(c);\n continue;\n case this.S.BEGIN_WHITESPACE:\n this.beginWhiteSpace(c);\n continue;\n case this.S.TEXT:\n if (this.sawRoot && !this.closedRoot) {\n const starti = i - 1;\n while (c && c !== '<' && c !== '&') {\n c = SAX.charAt(chunk, i++);\n if (c && this.trackPosition) {\n this.position++;\n if (c === '\\n') {\n this.line++;\n this.column = 0;\n }\n else {\n this.column++;\n }\n }\n }\n this.textNode += chunk.substring(starti, i - 1);\n }\n if (c === '<' && !(this.sawRoot && this.closedRoot && !this.strict)) {\n this.state = this.S.OPEN_WAKA;\n this.startTagPosition = this.position;\n }\n else {\n if (!SAX.isWhitespace(c) && (!this.sawRoot || this.closedRoot)) {\n this.strictFail('Text data outside of root node.');\n }\n if (c === '&') {\n this.state = this.S.TEXT_ENTITY;\n }\n else {\n this.textNode += c;\n }\n }\n continue;\n case this.S.SCRIPT:\n // only non-strict\n if (c === '<') {\n this.state = this.S.SCRIPT_ENDING;\n }\n else {\n this.script += c;\n }\n continue;\n case this.S.SCRIPT_ENDING:\n if (c === '/') {\n this.state = this.S.CLOSE_TAG;\n }\n else {\n this.script += `<${c}`;\n this.state = this.S.SCRIPT;\n }\n continue;\n case this.S.OPEN_WAKA:\n // either a /, ?, !, or text is coming next.\n if (c === '!') {\n this.state = this.S.SGML_DECL;\n this.sgmlDecl = '';\n }\n else if (SAX.isWhitespace(c)) {\n // wait for it...\n }\n else if (SAX.isMatch(nameStart, c)) {\n this.state = this.S.OPEN_TAG;\n this.tagName = c;\n }\n else if (c === '/') {\n this.state = this.S.CLOSE_TAG;\n this.tagName = '';\n }\n else if (c === '?') {\n this.state = this.S.PROC_INST;\n this.procInstName = this.procInstBody = '';\n }\n else {\n this.strictFail('Unencoded <');\n // if there was some whitespace, then add that in.\n if (this.startTagPosition + 1 < this.position) {\n const pad = this.position - this.startTagPosition;\n c = new Array(pad).join(' ') + c;\n }\n this.textNode += `<${c}`;\n this.state = this.S.TEXT;\n }\n continue;\n case this.S.SGML_DECL:\n if ((this.sgmlDecl + c).toUpperCase() === this.CDATA) {\n this.emitNode('onopencdata');\n this.state = this.S.CDATA;\n this.sgmlDecl = '';\n this.cdata = '';\n }\n else if (this.sgmlDecl + c === '--') {\n this.state = this.S.COMMENT;\n this.comment = '';\n this.sgmlDecl = '';\n }\n else if ((this.sgmlDecl + c).toUpperCase() === this.DOCTYPE) {\n this.state = this.S.DOCTYPE;\n if (this.doctype || this.sawRoot) {\n this.strictFail('Inappropriately located doctype declaration');\n }\n this.doctype = '';\n this.sgmlDecl = '';\n }\n else if (c === '>') {\n this.emitNode('onsgmldeclaration', this.sgmlDecl);\n this.sgmlDecl = '';\n this.state = this.S.TEXT;\n }\n else if (SAX.isQuote(c)) {\n this.state = this.S.SGML_DECL_QUOTED;\n this.sgmlDecl += c;\n }\n else {\n this.sgmlDecl += c;\n }\n continue;\n case this.S.SGML_DECL_QUOTED:\n if (c === this.q) {\n this.state = this.S.SGML_DECL;\n this.q = '';\n }\n this.sgmlDecl += c;\n continue;\n case this.S.DOCTYPE:\n if (c === '>') {\n this.state = this.S.TEXT;\n this.emitNode('ondoctype', this.doctype);\n this.doctype = true; // just remember that we saw it.\n }\n else {\n this.doctype += c;\n if (c === '[') {\n this.state = this.S.DOCTYPE_DTD;\n }\n else if (SAX.isQuote(c)) {\n this.state = this.S.DOCTYPE_QUOTED;\n this.q = c;\n }\n }\n continue;\n case this.S.DOCTYPE_QUOTED:\n this.doctype += c;\n if (c === this.q) {\n this.q = '';\n this.state = this.S.DOCTYPE;\n }\n continue;\n case this.S.DOCTYPE_DTD:\n this.doctype += c;\n if (c === ']') {\n this.state = this.S.DOCTYPE;\n }\n else if (SAX.isQuote(c)) {\n this.state = this.S.DOCTYPE_DTD_QUOTED;\n this.q = c;\n }\n continue;\n case this.S.DOCTYPE_DTD_QUOTED:\n this.doctype += c;\n if (c === this.q) {\n this.state = this.S.DOCTYPE_DTD;\n this.q = '';\n }\n continue;\n case this.S.COMMENT:\n if (c === '-') {\n this.state = this.S.COMMENT_ENDING;\n }\n else {\n this.comment += c;\n }\n continue;\n case this.S.COMMENT_ENDING:\n if (c === '-') {\n this.state = this.S.COMMENT_ENDED;\n this.comment = this.textApplyOptions(this.comment);\n if (this.comment) {\n this.emitNode('oncomment', this.comment);\n }\n this.comment = '';\n }\n else {\n this.comment += `-${c}`;\n this.state = this.S.COMMENT;\n }\n continue;\n case this.S.COMMENT_ENDED:\n if (c !== '>') {\n this.strictFail('Malformed comment');\n // allow <!-- blah -- bloo --> in non-strict mode,\n // which is a comment of \" blah -- bloo \"\n this.comment += `--${c}`;\n this.state = this.S.COMMENT;\n }\n else {\n this.state = this.S.TEXT;\n }\n continue;\n case this.S.CDATA:\n if (c === ']') {\n this.state = this.S.CDATA_ENDING;\n }\n else {\n this.cdata += c;\n }\n continue;\n case this.S.CDATA_ENDING:\n if (c === ']') {\n this.state = this.S.CDATA_ENDING_2;\n }\n else {\n this.cdata += `]${c}`;\n this.state = this.S.CDATA;\n }\n continue;\n case this.S.CDATA_ENDING_2:\n if (c === '>') {\n if (this.cdata) {\n this.emitNode('oncdata', this.cdata);\n }\n this.emitNode('onclosecdata');\n this.cdata = '';\n this.state = this.S.TEXT;\n }\n else if (c === ']') {\n this.cdata += ']';\n }\n else {\n this.cdata += `]]${c}`;\n this.state = this.S.CDATA;\n }\n continue;\n case this.S.PROC_INST:\n if (c === '?') {\n this.state = this.S.PROC_INST_ENDING;\n }\n else if (SAX.isWhitespace(c)) {\n this.state = this.S.PROC_INST_BODY;\n }\n else {\n this.procInstName += c;\n }\n continue;\n case this.S.PROC_INST_BODY:\n if (!this.procInstBody && SAX.isWhitespace(c)) {\n continue;\n }\n else if (c === '?') {\n this.state = this.S.PROC_INST_ENDING;\n }\n else {\n this.procInstBody += c;\n }\n continue;\n case this.S.PROC_INST_ENDING:\n if (c === '>') {\n this.emitNode('onprocessinginstruction', {\n name: this.procInstName,\n body: this.procInstBody\n });\n this.procInstName = this.procInstBody = '';\n this.state = this.S.TEXT;\n }\n else {\n this.procInstBody += `?${c}`;\n this.state = this.S.PROC_INST_BODY;\n }\n continue;\n case this.S.OPEN_TAG:\n if (SAX.isMatch(nameBody, c)) {\n this.tagName += c;\n }\n else {\n this.newTag();\n if (c === '>') {\n this.openTag();\n }\n else if (c === '/') {\n this.state = this.S.OPEN_TAG_SLASH;\n }\n else {\n if (!SAX.isWhitespace(c)) {\n this.strictFail('Invalid character in tag name');\n }\n this.state = this.S.ATTRIB;\n }\n }\n continue;\n case this.S.OPEN_TAG_SLASH:\n if (c === '>') {\n this.openTag(true);\n this.closeTag();\n }\n else {\n this.strictFail('Forward-slash in opening tag not followed by >');\n this.state = this.S.ATTRIB;\n }\n continue;\n case this.S.ATTRIB:\n // haven't read the attribute name yet.\n if (SAX.isWhitespace(c)) {\n continue;\n }\n else if (c === '>') {\n this.openTag();\n }\n else if (c === '/') {\n this.state = this.S.OPEN_TAG_SLASH;\n }\n else if (SAX.isMatch(nameStart, c)) {\n this.attribName = c;\n this.attribValue = '';\n this.state = this.S.ATTRIB_NAME;\n }\n else {\n this.strictFail('Invalid attribute name');\n }\n continue;\n case this.S.ATTRIB_NAME:\n if (c === '=') {\n this.state = this.S.ATTRIB_VALUE;\n }\n else if (c === '>') {\n this.strictFail('Attribute without value');\n this.attribValue = this.attribName;\n this.attrib();\n this.openTag();\n }\n else if (SAX.isWhitespace(c)) {\n this.state = this.S.ATTRIB_NAME_SAW_WHITE;\n }\n else if (SAX.isMatch(nameBody, c)) {\n this.attribName += c;\n }\n else {\n this.strictFail('Invalid attribute name');\n }\n continue;\n case this.S.ATTRIB_NAME_SAW_WHITE:\n if (c === '=') {\n this.state = this.S.ATTRIB_VALUE;\n }\n else if (SAX.isWhitespace(c)) {\n continue;\n }\n else {\n this.strictFail('Attribute without value');\n this.tag.attributes[this.attribName] = '';\n this.attribValue = '';\n this.emitNode('onattribute', {\n name: this.attribName,\n value: ''\n });\n this.attribName = '';\n if (c === '>') {\n this.openTag();\n }\n else if (SAX.isMatch(nameStart, c)) {\n this.attribName = c;\n this.state = this.S.ATTRIB_NAME;\n }\n else {\n this.strictFail('Invalid attribute name');\n this.state = this.S.ATTRIB;\n }\n }\n continue;\n case this.S.ATTRIB_VALUE:\n if (SAX.isWhitespace(c)) {\n continue;\n }\n else if (SAX.isQuote(c)) {\n this.q = c;\n this.state = this.S.ATTRIB_VALUE_QUOTED;\n }\n else {\n this.strictFail('Unquoted attribute value');\n this.state = this.S.ATTRIB_VALUE_UNQUOTED;\n this.attribValue = c;\n }\n continue;\n case this.S.ATTRIB_VALUE_QUOTED:\n if (c !== this.q) {\n if (c === '&') {\n this.state = this.S.ATTRIB_VALUE_ENTITY_Q;\n }\n else {\n this.attribValue += c;\n }\n continue;\n }\n this.attrib();\n this.q = '';\n this.state = this.S.ATTRIB_VALUE_CLOSED;\n continue;\n case this.S.ATTRIB_VALUE_CLOSED:\n if (SAX.isWhitespace(c)) {\n this.state = this.S.ATTRIB;\n }\n else if (c === '>') {\n this.openTag();\n }\n else if (c === '/') {\n this.state = this.S.OPEN_TAG_SLASH;\n }\n else if (SAX.isMatch(nameStart, c)) {\n this.strictFail('No whitespace between attributes');\n this.attribName = c;\n this.attribValue = '';\n this.state = this.S.ATTRIB_NAME;\n }\n else {\n this.strictFail('Invalid attribute name');\n }\n continue;\n case this.S.ATTRIB_VALUE_UNQUOTED:\n if (!SAX.isAttribEnd(c)) {\n if (c === '&') {\n this.state = this.S.ATTRIB_VALUE_ENTITY_U;\n }\n else {\n this.attribValue += c;\n }\n continue;\n }\n this.attrib();\n if (c === '>') {\n this.openTag();\n }\n else {\n this.state = this.S.ATTRIB;\n }\n continue;\n case this.S.CLOSE_TAG:\n if (!this.tagName) {\n if (SAX.isWhitespace(c)) {\n continue;\n }\n else if (SAX.notMatch(nameStart, c)) {\n if (this.script) {\n this.script += `</${c}`;\n this.state = this.S.SCRIPT;\n }\n else {\n this.strictFail('Invalid tagname in closing tag.');\n }\n }\n else {\n this.tagName = c;\n }\n }\n else if (c === '>') {\n this.closeTag();\n }\n else if (SAX.isMatch(nameBody, c)) {\n this.tagName += c;\n }\n else if (this.script) {\n this.script += `</${this.tagName}`;\n this.tagName = '';\n this.state = this.S.SCRIPT;\n }\n else {\n if (!SAX.isWhitespace(c)) {\n this.strictFail('Invalid tagname in closing tag');\n }\n this.state = this.S.CLOSE_TAG_SAW_WHITE;\n }\n continue;\n case this.S.CLOSE_TAG_SAW_WHITE:\n if (SAX.isWhitespace(c)) {\n continue;\n }\n if (c === '>') {\n this.closeTag();\n }\n else {\n this.strictFail('Invalid characters in closing tag');\n }\n continue;\n case this.S.TEXT_ENTITY:\n case this.S.ATTRIB_VALUE_ENTITY_Q:\n case this.S.ATTRIB_VALUE_ENTITY_U:\n let returnState;\n let buffer;\n switch (this.state) {\n case this.S.TEXT_ENTITY:\n returnState = this.S.TEXT;\n buffer = 'textNode';\n break;\n case this.S.ATTRIB_VALUE_ENTITY_Q:\n returnState = this.S.ATTRIB_VALUE_QUOTED;\n buffer = 'attribValue';\n break;\n case this.S.ATTRIB_VALUE_ENTITY_U:\n returnState = this.S.ATTRIB_VALUE_UNQUOTED;\n buffer = 'attribValue';\n break;\n default:\n throw new Error(`Unknown state: ${this.state}`);\n }\n if (c === ';') {\n this[buffer] += this.parseEntity();\n this.entity = '';\n this.state = returnState;\n }\n else if (SAX.isMatch(this.entity.length ? entityBody : entityStart, c)) {\n this.entity += c;\n }\n else {\n this.strictFail('Invalid character in entity name');\n this[buffer] += `&${this.entity}${c}`;\n this.entity = '';\n this.state = returnState;\n }\n continue;\n default:\n throw new Error(`Unknown state: ${this.state}`);\n }\n } // while\n if (this.position >= this.bufferCheckPosition) {\n this.checkBufferLength();\n }\n return this;\n }\n emit(event, data) {\n if (this.events.hasOwnProperty(event)) {\n const eventName = event.replace(/^on/, '');\n this.events[event](data, eventName, this);\n }\n }\n clearBuffers() {\n for (let i = 0, l = this.BUFFERS.length; i < l; i++) {\n this[this[i]] = '';\n }\n }\n flushBuffers() {\n this.closeText();\n if (this.cdata !== '') {\n this.emitNode('oncdata', this.cdata);\n this.cdata = '';\n }\n if (this.script !== '') {\n this.emitNode('onscript', this.script);\n this.script = '';\n }\n }\n end() {\n if (this.sawRoot && !this.closedRoot)\n this.strictFail('Unclosed root tag');\n if (this.state !== this.S.BEGIN &&\n this.state !== this.S.BEGIN_WHITESPACE &&\n this.state !== this.S.TEXT) {\n this.errorFunction('Unexpected end');\n }\n this.closeText();\n this.c = '';\n this.closed = true;\n this.emit('onend');\n return new SAXParser(this.opt);\n }\n errorFunction(er) {\n this.closeText();\n if (this.trackPosition) {\n er += `\\nLine: ${this.line}\\nColumn: ${this.column}\\nChar: ${this.c}`;\n }\n const error = new Error(er);\n this.error = error;\n this.emit('onerror', error);\n return this;\n }\n attrib() {\n if (!this.strict) {\n this.attribName = this.attribName[this.looseCase]();\n }\n if (this.attribList.indexOf(this.attribName) !== -1 ||\n this.tag.attributes.hasOwnProperty(this.attribName)) {\n this.attribName = this.attribValue = '';\n return;\n }\n if (this.opt.xmlns) {\n const qn = SAX.qname(this.attribName, true);\n const prefix = qn.prefix;\n const local = qn.local;\n if (prefix === 'xmlns') {\n // namespace binding attribute. push the binding into scope\n if (local === 'xml' && this.attribValue !== this.XML_NAMESPACE) {\n this.strictFail(`xml: prefix must be bound to ${this.XML_NAMESPACE}\\n` + `Actual: ${this.attribValue}`);\n }\n else if (local === 'xmlns' && this.attribValue !== this.XMLNS_NAMESPACE) {\n this.strictFail(`xmlns: prefix must be bound to ${this.XMLNS_NAMESPACE}\\n` +\n `Actual: ${this.attribValue}`);\n }\n else {\n const tag = this.tag;\n const parent = this.tags[this.tags.length - 1] || this;\n if (tag.ns === parent.ns) {\n tag.ns = Object.create(parent.ns);\n }\n tag.ns[local] = this.attribValue;\n }\n }\n // defer onattribute events until all attributes have been seen\n // so any new bindings can take effect. preserve attribute order\n // so deferred events can be emitted in document order\n this.attribList.push([this.attribName, this.attribValue]);\n }\n else {\n // in non-xmlns mode, we can emit the event right away\n this.tag.attributes[this.attribName] = this.attribValue;\n this.emitNode('onattribute', {\n name: this.attribName,\n value: this.attribValue\n });\n }\n this.attribName = this.attribValue = '';\n }\n newTag() {\n if (!this.strict)\n this.tagName = this.tagName[this.looseCase]();\n const parent = this.tags[this.tags.length - 1] || this;\n const tag = (this.tag = { name: this.tagName, attributes: {} });\n // will be overridden if tag contains an xmlns=\"foo\" or xmlns:foo=\"bar\"\n if (this.opt.xmlns) {\n tag.ns = parent.ns;\n }\n this.attribList.length = 0;\n this.emitNode('onopentagstart', tag);\n }\n parseEntity() {\n let entity = this.entity;\n const entityLC = entity.toLowerCase();\n let num = NaN;\n let numStr = '';\n if (this.ENTITIES[entity]) {\n return this.ENTITIES[entity];\n }\n if (this.ENTITIES[entityLC]) {\n return this.ENTITIES[entityLC];\n }\n entity = entityLC;\n if (entity.charAt(0) === '#') {\n if (entity.charAt(1) === 'x') {\n entity = entity.slice(2);\n // TODO: remove tslint:disable\n // tslint:disable-next-line\n num = parseInt(entity, 16);\n numStr = num.toString(16);\n }\n else {\n entity = entity.slice(1);\n // TODO: remove tslint:disable\n // tslint:disable-next-line\n num = parseInt(entity, 10);\n numStr = num.toString(10);\n }\n }\n entity = entity.replace(/^0+/, '');\n if (isNaN(num) || numStr.toLowerCase() !== entity) {\n this.strictFail('Invalid character entity');\n return `&${this.entity};`;\n }\n return String.fromCodePoint(num);\n }\n beginWhiteSpace(c) {\n if (c === '<') {\n this.state = this.S.OPEN_WAKA;\n this.startTagPosition = this.position;\n }\n else if (!SAX.isWhitespace(c)) {\n // have to process this as a text node.\n // weird, but happens.\n this.strictFail('Non-whitespace before first tag.');\n this.textNode = c;\n this.state = this.S.TEXT;\n }\n else {\n }\n }\n strictFail(message) {\n if (typeof this !== 'object' || !(this instanceof SAXParser)) {\n throw new Error('bad call to strictFail');\n }\n if (this.strict) {\n this.errorFunction(message);\n }\n }\n textApplyOptions(text) {\n if (this.opt.trim)\n text = text.trim();\n if (this.opt.normalize)\n text = text.replace(/\\s+/g, ' ');\n return text;\n }\n emitNode(nodeType, data) {\n if (this.textNode)\n this.closeText();\n this.emit(nodeType, data);\n }\n closeText() {\n this.textNode = this.textApplyOptions(this.textNode);\n // TODO: figure out why this.textNode can be \"\" and \"undefined\"\n if (this.textNode !== undefined && this.textNode !== '' && this.textNode !== 'undefined') {\n this.emit('ontext', this.textNode);\n }\n this.textNode = '';\n }\n checkBufferLength() {\n const maxAllowed = Math.max(this.opt.MAX_BUFFER_LENGTH, 10);\n let maxActual = 0;\n for (let i = 0, l = this.BUFFERS.length; i < l; i++) {\n const len = this[this.BUFFERS[i]]?.length || 0;\n if (len > maxAllowed) {\n // Text/cdata nodes can get big, and since they're buffered,\n // we can get here under normal conditions.\n // Avoid issues by emitting the text node now,\n // so at least it won't get any bigger.\n switch (this.BUFFERS[i]) {\n case 'textNode':\n this.closeText();\n break;\n case 'cdata':\n this.emitNode('oncdata', this.cdata);\n this.cdata = '';\n break;\n case 'script':\n this.emitNode('onscript', this.script);\n this.script = '';\n break;\n default:\n this.errorFunction(`Max buffer length exceeded: ${this.BUFFERS[i]}`);\n }\n }\n maxActual = Math.max(maxActual, len);\n }\n // schedule the next check for the earliest possible buffer overrun.\n const m = this.opt.MAX_BUFFER_LENGTH - maxActual;\n this.bufferCheckPosition = m + this.position;\n }\n openTag(selfClosing) {\n if (this.opt.xmlns) {\n // emit namespace binding events\n const tag = this.tag;\n // add namespace info to tag\n const qn = SAX.qname(this.tagName);\n tag.prefix = qn.prefix;\n tag.local = qn.local;\n tag.uri = tag.ns[qn.prefix] || '';\n if (tag.prefix && !tag.uri) {\n this.strictFail(`Unbound namespace prefix: ${JSON.stringify(this.tagName)}`);\n tag.uri = qn.prefix;\n }\n const parent = this.tags[this.tags.length - 1] || this;\n if (tag.ns && parent.ns !== tag.ns) {\n const that = this;\n Object.keys(tag.ns).forEach((p) => {\n that.emitNode('onopennamespace', {\n prefix: p,\n uri: tag.ns[p]\n });\n });\n }\n // handle deferred onattribute events\n // Note: do not apply default ns to attributes:\n // http://www.w3.org/TR/REC-xml-names/#defaulting\n for (let i = 0, l = this.attribList.length; i < l; i++) {\n const nv = this.attribList[i];\n const name = nv[0];\n const value = nv[1];\n const qualName = SAX.qname(name, true);\n const prefix = qualName.prefix;\n const local = qualName.local;\n const uri = prefix === '' ? '' : tag.ns[prefix] || '';\n const a = {\n name,\n value,\n prefix,\n local,\n uri\n };\n // if there's any attributes with an undefined namespace,\n // then fail on them now.\n if (prefix && prefix !== 'xmlns' && !uri) {\n this.strictFail(`Unbound namespace prefix: ${JSON.stringify(prefix)}`);\n a.uri = prefix;\n }\n this.tag.attributes[name] = a;\n this.emitNode('onattribute', a);\n }\n this.attribList.length = 0;\n }\n this.tag.isSelfClosing = Boolean(selfClosing);\n // process the tag\n this.sawRoot = true;\n this.tags.push(this.tag);\n this.emitNode('onopentag', this.tag);\n if (!selfClosing) {\n // special case for <script> in non-strict mode.\n if (!this.noscript && this.tagName.toLowerCase() === 'script') {\n this.state = this.S.SCRIPT;\n }\n else {\n this.state = this.S.TEXT;\n }\n this.tag = null;\n this.tagName = '';\n }\n this.attribName = this.attribValue = '';\n this.attribList.length = 0;\n }\n closeTag() {\n if (!this.tagName) {\n this.strictFail('Weird empty close tag.');\n this.textNode += '</>';\n this.state = this.S.TEXT;\n return;\n }\n if (this.script) {\n if (this.tagName !== 'script') {\n this.script += `</${this.tagName}>`;\n this.tagName = '';\n this.state = this.S.SCRIPT;\n return;\n }\n this.emitNode('onscript', this.script);\n this.script = '';\n }\n // first make sure that the closing tag actually exists.\n // <a><b></c></b></a> will close everything, otherwise.\n let t = this.tags.length;\n let tagName = this.tagName;\n if (!this.strict) {\n tagName = tagName[this.looseCase]();\n }\n while (t--) {\n const close = this.tags[t];\n if (close.name !== tagName) {\n // fail the first time in strict mode\n this.strictFail('Unexpected close tag');\n }\n else {\n break;\n }\n }\n // didn't find it. we already failed for strict, so just abort.\n if (t < 0) {\n this.strictFail(`Unmatched closing tag: ${this.tagName}`);\n this.textNode += `</${this.tagName}>`;\n this.state = this.S.TEXT;\n return;\n }\n this.tagName = tagName;\n let s = this.tags.length;\n while (s-- > t) {\n const tag = (this.tag = this.tags.pop());\n this.tagName = this.tag.name;\n this.emitNode('onclosetag', this.tagName);\n const x = {};\n for (const i in tag.ns) {\n if (tag.ns.hasOwnProperty(i)) {\n x[i] = tag.ns[i];\n }\n }\n const parent = this.tags[this.tags.length - 1] || this;\n if (this.opt.xmlns && tag.ns !== parent.ns) {\n // remove namespace bindings introduced by tag\n const that = this;\n Object.keys(tag.ns).forEach((p) => {\n const n = tag.ns[p];\n that.emitNode('onclosenamespace', { prefix: p, uri: n });\n });\n }\n }\n if (t === 0)\n this.closedRoot = true;\n this.tagName = this.attribValue = this.attribName = '';\n this.attribList.length = 0;\n this.state = this.S.TEXT;\n }\n}\n/**\n *\n * @todo Weird inheritance, with some variables initialized in subclass\n */\nexport class SAXParser extends SAX {\n static ENTITIES = ENTITIES;\n opt = DEFAULT_SAX_PARSER_OPTIONS;\n events = DEFAULT_SAX_EVENTS;\n constructor(opt) {\n super();\n this.clearBuffers();\n this.opt = opt = { ...this.opt, ...opt };\n this.events = { ...this.events, ...opt };\n this.q = this.c = '';\n this.opt.lowercase = this.opt.lowercase || this.opt.lowercasetags;\n this.bufferCheckPosition = this.opt.MAX_BUFFER_LENGTH;\n this.looseCase = this.opt.lowercase ? 'toLowerCase' : 'toUpperCase';\n this.tags = [];\n this.closed = this.closedRoot = this.sawRoot = false;\n this.tag = this.error = null;\n this.strict = Boolean(this.opt.strict);\n this.noscript = Boolean(this.opt.strict || this.opt.noscript);\n this.state = this.S.BEGIN;\n this.strictEntities = this.opt.strictEntities;\n this.ENTITIES = this.strictEntities\n ? Object.create(this.XML_ENTITIES)\n : Object.create(this.ENTITIES);\n this.attribList = [];\n // namespaces form a prototype chain.\n // it always points at the current tag,\n // which protos to its parent tag.\n if (this.opt.xmlns) {\n this.ns = Object.create(this.rootNS);\n }\n // mostly just for error reporting\n this.trackPosition = this.opt.position !== false;\n if (this.trackPosition) {\n this.position = this.line = this.column = 0;\n }\n this.emit('onready');\n }\n resume() {\n this.error = null;\n return this;\n }\n close() {\n return this.write(null);\n }\n flush() {\n this.flushBuffers();\n }\n}\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n/**\n * Uncapitalize first letter of a string\n * @param str\n * @returns\n */\nexport function uncapitalize(str) {\n return typeof str === 'string' ? str.charAt(0).toLowerCase() + str.slice(1) : str;\n}\n/**\n * Recursively uncapitalize all keys in a nested object\n * @param object\n * @returns\n */\nexport function uncapitalizeKeys(object) {\n if (Array.isArray(object)) {\n return object.map((element) => uncapitalizeKeys(element));\n }\n if (object && typeof object === 'object') {\n const newObject = {};\n for (const [key, value] of Object.entries(object)) {\n newObject[uncapitalize(key)] = uncapitalizeKeys(value);\n }\n return newObject;\n }\n return object;\n}\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { StreamingXMLParser } from \"./streaming-xml-parser.js\";\nimport { uncapitalizeKeys } from \"../xml-utils/uncapitalize.js\";\nimport { XMLParser as FastXMLParser } from 'fast-xml-parser';\nexport function parseXMLSync(text, options) {\n if (options?._parser && options._parser !== 'fast-xml-parser') {\n throw new Error(options?._parser);\n }\n const fastXMLOptions = {\n // Default FastXML options\n // https://github.com/NaturalIntelligence/fast-xml-parser/blob/master/docs/v4/2.XMLparseOptions.md#allowbooleanattributes\n allowBooleanAttributes: true,\n // https://github.com/NaturalIntelligence/fast-xml-parser/blob/master/docs/v4/2.XMLparseOptions.md#ignoredeclaration\n ignoreDeclaration: true,\n // https://github.com/NaturalIntelligence/fast-xml-parser/blob/master/docs/v4/2.XMLparseOptions.md#removensprefix\n removeNSPrefix: options?.removeNSPrefix,\n // https://github.com/NaturalIntelligence/fast-xml-parser/blob/master/docs/v4/2.XMLparseOptions.md#textnodename\n textNodeName: options?.textNodeName,\n // Let's application specify keys that are always arrays\n isArray: (name, jpath, isLeafNode, isAttribute) => {\n const array = Boolean(options?.arrayPaths?.some((path) => jpath === path));\n return array;\n },\n // Application overrides\n ...options?._fastXML\n };\n const xml = fastParseXML(text, fastXMLOptions);\n // Note - could be done with FastXML tag processing\n return options?.uncapitalizeKeys ? uncapitalizeKeys(xml) : xml;\n}\nexport function fastParseXML(text, options) {\n const parser = new FastXMLParser({\n ignoreAttributes: false,\n attributeNamePrefix: '',\n ...options\n });\n const parsedXML = parser.parse(text);\n return parsedXML;\n}\n/**\n * @todo Build a streaming XML parser based on sax-js\n * @param text\n * @param options\n * @returns\n */\nexport function parseXMLInBatches(text, options = {}) {\n const parser = new StreamingXMLParser({\n ...options,\n strict: true\n });\n parser.write(text);\n parser.close();\n return parser.result;\n}\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { parseXMLSync } from \"./lib/parsers/parse-xml.js\";\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof \"4.3.3\" !== 'undefined' ? \"4.3.3\" : 'latest';\n/**\n * Loader for XML files\n */\nexport const XMLLoader = {\n dataType: null,\n batchType: null,\n name: 'XML',\n id: 'xml',\n module: 'xml',\n version: VERSION,\n worker: false,\n extensions: ['xml'],\n mimeTypes: ['application/xml', 'text/xml'],\n testText: testXMLFile,\n options: {\n xml: {\n _parser: 'fast-xml-parser',\n uncapitalizeKeys: false,\n removeNSPrefix: false,\n textNodeName: 'value',\n arrayPaths: []\n }\n },\n parse: async (arrayBuffer, options) => parseXMLSync(new TextDecoder().decode(arrayBuffer), {\n ...XMLLoader.options.xml,\n ...options?.xml\n }),\n parseTextSync: (text, options) => parseXMLSync(text, { ...XMLLoader.options.xml, ...options?.xml })\n};\nfunction testXMLFile(text) {\n // TODO - There could be space first.\n return text.startsWith('<?xml');\n}\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { mergeLoaderOptions } from '@loaders.gl/loader-utils';\nimport { XMLLoader } from \"./xml-loader.js\";\n/**\n * Loader for HTML files\n * Essentially a copy of the XMLLoader with different mime types, file extensions and content tests.\n * This split enables applications can control whether they want HTML responses to be parsed by the XML loader or not.\n * This loader does not have any additional understanding of the structure of HTML or the document.\n */\nexport const HTMLLoader = {\n ...XMLLoader,\n name: 'HTML',\n id: 'html',\n extensions: ['html', 'htm'],\n mimeTypes: ['text/html'],\n testText: testHTMLFile,\n parse: async (arrayBuffer, options) => parseTextSync(new TextDecoder().decode(arrayBuffer), options),\n parseTextSync: (text, options) => parseTextSync(text, options)\n};\nfunction testHTMLFile(text) {\n // TODO - There could be space first.\n return text.startsWith('<html');\n}\nfunction parseTextSync(text, options) {\n // fast-xml-parser can recognize HTML entities\n // https://github.com/NaturalIntelligence/fast-xml-parser/blob/master/docs/v4/2.XMLparseOptions.md#htmlentities\n // https://github.com/NaturalIntelligence/fast-xml-parser/blob/master/docs/v4/5.Entities.md\n options = mergeLoaderOptions(options, {\n xml: {\n _parser: 'fast-xml-parser',\n _fastXML: {\n htmlEntities: true\n }\n }\n });\n return XMLLoader.parseTextSync?.(text, options);\n}\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n// TODO - these utilities could be moved to the XML parser.\n// uncapitalizeKeys could be an XMLLoader option\n/**\n * Extracts a value or array and always return an array\n * Useful since XML parses to object instead of array when only a single value is provided\n */\nexport function convertXMLValueToArray(xmlValue) {\n if (Array.isArray(xmlValue)) {\n return xmlValue;\n }\n if (xmlValue && typeof xmlValue === 'object' && xmlValue['0']) {\n // Error this is an objectified array\n }\n if (xmlValue) {\n return [xmlValue];\n }\n return [];\n}\n/**\n * Mutates a field in place, converting it to array\n * Useful since XML parses to object instead of array when only a single value is provided\n */\nexport function convertXMLFieldToArrayInPlace(xml, key) {\n xml[key] = convertXMLValueToArray(xml[key]);\n}\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACGA,IAAM,qBAAqB;AAAA,EACvB,QAAQ,MAAM;AAAA,EAAE;AAAA,EAChB,yBAAyB,MAAM;AAAA,EAAE;AAAA,EACjC,mBAAmB,MAAM;AAAA,EAAE;AAAA,EAC3B,WAAW,MAAM;AAAA,EAAE;AAAA,EACnB,WAAW,MAAM;AAAA,EAAE;AAAA,EACnB,gBAAgB,MAAM;AAAA,EAAE;AAAA,EACxB,aAAa,MAAM;AAAA,EAAE;AAAA,EACrB,WAAW,MAAM;AAAA,EAAE;AAAA,EACnB,YAAY,MAAM;AAAA,EAAE;AAAA,EACpB,aAAa,MAAM;AAAA,EAAE;AAAA,EACrB,SAAS,MAAM;AAAA,EAAE;AAAA,EACjB,cAAc,MAAM;AAAA,EAAE;AAAA,EACtB,SAA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S;AAzBtC;AA6BI,gBAAU,wCAAmB,SAAS;AAAA,IAClC,KAAK;AAAA,MACD,SAAS;AAAA,MACT,UAAU;AAAA,QACN,cAAc;AAAA,MAClB;AAAA,IACJ;AAAA,EACJ,CAAC;AACD,UAAO,sBAAU,kBAAV,4BAA0B,MAAM;AAC3C;;;AC7BO,SAAS,uBAAuB,UAAU;AAC7C,MAAI,MAAM,QAAQ,QAAQ,GAAG;AACzB,WAAO;AAAA,EACX;AACA,MAAI,YAAY,OAAO,aAAa,YAAY,SAAS,GAAG,GAAG;AAAA,EAE/D;AACA,MAAI,UAAU;AACV,WAAO,CAAC,QAAQ;AAAA,EACpB;AACA,SAAO,CAAC;AACZ;AAKO,SAAS,8BAA8B,KAAK,KAAK;AACpD,MAAI,GAAG,IAAI,uBAAuB,IAAI,GAAG,CAAC;AAC9C;",
|
|
6
6
|
"names": ["FastXMLParser"]
|
|
7
7
|
}
|
package/dist/xml-loader.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { parseXMLSync } from "./lib/parsers/parse-xml.js";
|
|
5
5
|
// __VERSION__ is injected by babel-plugin-version-inline
|
|
6
6
|
// @ts-ignore TS2304: Cannot find name '__VERSION__'.
|
|
7
|
-
const VERSION = typeof "4.3.
|
|
7
|
+
const VERSION = typeof "4.3.3" !== 'undefined' ? "4.3.3" : 'latest';
|
|
8
8
|
/**
|
|
9
9
|
* Loader for XML files
|
|
10
10
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loaders.gl/xml",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.4",
|
|
4
4
|
"description": "Framework-independent loaders for the XML (eXtensible Markup Language) format",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -41,12 +41,12 @@
|
|
|
41
41
|
"build-bundle-dev": "ocular-bundle ./bundle.ts --env=dev --output=dist/dist.dev.js"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@loaders.gl/loader-utils": "4.3.
|
|
45
|
-
"@loaders.gl/schema": "4.3.
|
|
44
|
+
"@loaders.gl/loader-utils": "4.3.4",
|
|
45
|
+
"@loaders.gl/schema": "4.3.4",
|
|
46
46
|
"fast-xml-parser": "^4.2.5"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
49
|
"@loaders.gl/core": "^4.3.0"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "d18246f4ef6382f787a6ae2e9e21d8a7f40e5917"
|
|
52
52
|
}
|