Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

forest

Package Overview
Dependencies
Maintainers
3
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

forest - npm Package Compare versions

Comparing version 0.18.1 to 0.18.2

2

package.json
{
"name": "forest",
"version": "0.18.1",
"version": "0.18.2",
"description": "UI engine for web",

@@ -5,0 +5,0 @@ "main": "forest.cjs.js",

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

function t(t,e){t.sibling.right=e,t.nextSibling=e}function e(t){return"-"+t.toLowerCase()}function i(t){switch(t){case'&':return'&amp;';case'<':return'&lt;';case'>':return'&gt;';case'"':return'&quot;';case"'":return'&#39;';default:return t}}function s(t){switch(t=String(t)){case'__proto__':case'__defineGetter__':case'__defineSetter__':case'constructor':case'prototype':case'hasOwnProperty':case'toString':case'valueOf':return'blacklisted';default:return t.replace(n,'')}}function r(t){return String(t).replace(a,'')}Object.defineProperty(exports,'__esModule',{value:1});var l=require('forest');const n=/[^a-zA-Z0-9\-_]/g,a=/[\\<>"]/g,h=/[A-Z]/g,o=/[&<>'"]/g;class u{constructor(){this.child={first:null,last:null},this.sibling={left:null,right:null},this.parent=null,this.tagName='',this.nodeName='',this.namespaceURI='http://www.w3.org/1999/xhtml',this.dataset=Object.create(null),this.style=new c,this.value=void 0,this.firstChild=null,this.nextSibling=null,this.transform={baseVal:new g},this.isFragment=1,this.attributes=Object.create(null),this.textContent=null,this.__STATIC__=1}cloneNode(){let t=new u;t.tagName=this.tagName,t.nodeName=this.nodeName,t.namespaceURI=this.namespaceURI,Object.assign(t.dataset,this.dataset),Object.assign(t.style.properties,this.style.properties),t.value=this.value;for(let{value:e}of this.transform.baseVal.items){let i=new f;i.value=e,t.transform.baseVal.items.push(i)}return t.isFragment=this.isFragment,Object.assign(t.attributes,this.attributes),t.textContent=this.textContent,t}after(e){this.sibling.right!==e&&(e.parent&&e.remove(),this.parent&&(this.sibling.right?(this.sibling.right.sibling.left=e,t(e,this.sibling.right)):this.parent.child.last=e,t(this,e),e.sibling.left=this,e.parent=this.parent))}prepend(e){e.parent&&e.remove(),this.child.last?(this.child.first.sibling.left=e,t(e,this.child.first)):(this.child.first=e,this.child.last=e),this.child.first=e,this.firstChild=e,e.parent=this}remove(){if(!this.parent)return;let{parent:e}=this;e.child.first===this&&e.child.last===this?(e.firstChild=null,e.child.first=null,e.child.last=null):e.child.first===this?(e.child.first=this.sibling.right,e.firstChild=this.sibling.right,this.sibling.right.sibling.left=null):e.child.last===this?(e.child.last=this.sibling.left,t(this.sibling.left,null)):(this.sibling.right.sibling.left=this.sibling.left,t(this.sibling.left,this.sibling.right)),this.sibling.left=null,t(this,null),this.parent=null}addEventListener(t,e,i){}removeEventListener(t,e,i){}setAttribute(t,e){this.attributes[s(t)]=r(e)}removeAttribute(t){delete this.attributes[s(t)]}replaceWith(e){if(!this.parent)return;let{parent:i}=this;e.parent&&e.remove(),i.child.first===this&&i.child.last===this?(i.firstChild=e,i.child.first=e,i.child.last=e):i.child.first===this?(i.child.first=e,i.firstChild=e,this.sibling.right.sibling.left=e):i.child.last===this?(i.child.last=e,t(this.sibling.left,e)):(this.sibling.right.sibling.left=e,t(this.sibling.left,e)),e.sibling.left=this.sibling.left,t(e,this.sibling.right),e.parent=i,this.sibling.left=null,t(this,null),this.parent=null}createSVGTransform(){return new f}replaceData(t,e,i){'string'==typeof this.textContent&&(this.textContent=`${this.textContent.slice(0,t)}${i}${this.textContent.slice(t+e)}`)}splitText(t){if('string'!=typeof this.textContent)return null;let e=new u;return e.nodeName='#text',e.textContent=this.textContent.slice(t),this.textContent=this.textContent.slice(0,t),this.after(e),e}}class c{constructor(){this.properties=Object.create(null)}setProperty(t,e){this.properties[s(t)]=r(e)}removeProperty(t){delete this.properties[s(t)]}}class g{constructor(){this.items=[]}appendItem(t){this.items.push(t)}}class f{constructor(){this.value=''}setTranslate(t,e){this.value=`translate(${t} ${e})`}setScale(t,e){this.value=`scale(${t} ${e})`}setRotate(t,e,i){this.value=0!==e||0!==i?`rotate(${t} ${e} ${i})`:`rotate(${t})`}setSkewX(t){this.value=`skewX(${t})`}setSkewY(t){this.value=`skewY(${t})`}}const p=['area','base','br','col','embed','hr','img','input','keygen','link','meta','param','source','track','wbr'];exports.renderStatic=t=>{let n,a={document:{createTextNode(t){let e=new u;return e.textContent=String(t).replace(o,i),e.nodeName='#text',e},createElement(t){let e=new u;return e.tagName=s(t),e.isFragment=0,e},createElementNS(t,e){switch(t){case'http://www.w3.org/1999/xhtml':case'http://www.w3.org/2000/svg':break;default:t='http://www.w3.org/1999/xhtml'}let i=new u;return i.tagName=s(e),i.namespaceURI=t,i.isFragment=0,i},createDocumentFragment:()=>new u}},c=a.document.createDocumentFragment();return'object'==typeof t&&null!==t&&(n=t.scope,t=t.fn),new Promise(i=>{l.using(c,{fn:t,env:a,scope:n,onComplete(){i((t=>{let i=[];(function t(i,l){if(null!==i.textContent&&l.push(i.textContent),i.isFragment){let e=i.firstChild;for(;e;)t(e,l),e=e.sibling.right;return}l.push('<',i.tagName);for(let t in i.attributes)l.push(' ',t,'=','"',r(i.attributes[t]),'"');for(let t in i.dataset)l.push(' ','data-',s(t).replace(h,e),'=','"',r(i.dataset[t]),'"');let n=[];for(let t in i.style.properties)if(t.startsWith('--'))n.push(`${t}: ${i.style.properties[t]}`);else{let e=t.replace(/[A-Z]/g,t=>"-"+t.toLowerCase());(t.startsWith('webkit')||t.startsWith('moz'))&&(e="-"+e),n.push(`${e}: ${i.style.properties[t]}`)}if(n.length>0&&l.push(' ','style','=','"',n.join(';'),'"'),i.transform.baseVal.items.length>0){l.push(' ','transform','=','"');let t=i.transform.baseVal.items.map(({value:t})=>t);l.push(t.join(' '),'"')}if(l.push('>'),p.includes(i.tagName))return;let a=i.firstChild;for(;a;)t(a,l),a=a.sibling.right;l.push('</',i.tagName,'>')})(t,i);let l=i.join('');return function t(e){if('html'===e.tagName)return 1;if(e.isFragment&&null===e.textContent){let i=e.firstChild;if(i&&e.child.last===i)return t(i)}return 0}(t)?"<!DOCTYPE html>"+l:l})(c))}})})};
function t(t,e){t.sibling.right=e,t.nextSibling=e}function e(t){return"-"+t.toLowerCase()}function i(t){switch(t){case'&':return'&amp;';case'<':return'&lt;';case'>':return'&gt;';case'"':return'&quot;';case"'":return'&#39;';default:return t}}function s(t){switch(t=String(t)){case'__proto__':case'__defineGetter__':case'__defineSetter__':case'constructor':case'prototype':case'hasOwnProperty':case'toString':case'valueOf':return'blacklisted';default:return t.replace(l,'')}}function n(t){return String(t).replace(h,'')}Object.defineProperty(exports,'__esModule',{value:1});var r=require('forest');const l=/[^a-zA-Z0-9\-_]/g,h=/[\\<>"]/g,a=/[A-Z]/g,c=/[&<>'"]/g;class o{constructor(){this.child={first:null,last:null},this.sibling={left:null,right:null},this.parent=null,this.tagName='',this.nodeName='',this.namespaceURI='http://www.w3.org/1999/xhtml',this.dataset=Object.create(null),this.style=new u,this.value=void 0,this.firstChild=null,this.nextSibling=null,this.isFragment=1,this.attributes=Object.create(null),this.textContent=null,this.__STATIC__=1}cloneNode(){let t=new o;return t.tagName=this.tagName,t.nodeName=this.nodeName,t.namespaceURI=this.namespaceURI,Object.assign(t.dataset,this.dataset),Object.assign(t.style.properties,this.style.properties),t.value=this.value,t.isFragment=this.isFragment,Object.assign(t.attributes,this.attributes),t.textContent=this.textContent,t}after(e){this.sibling.right!==e&&(e.parent&&e.remove(),this.parent&&(this.sibling.right?(this.sibling.right.sibling.left=e,t(e,this.sibling.right)):this.parent.child.last=e,t(this,e),e.sibling.left=this,e.parent=this.parent))}prepend(e){e.parent&&e.remove(),this.child.last?(this.child.first.sibling.left=e,t(e,this.child.first)):(this.child.first=e,this.child.last=e),this.child.first=e,this.firstChild=e,e.parent=this}remove(){if(!this.parent)return;let{parent:e}=this;e.child.first===this&&e.child.last===this?(e.firstChild=null,e.child.first=null,e.child.last=null):e.child.first===this?(e.child.first=this.sibling.right,e.firstChild=this.sibling.right,this.sibling.right.sibling.left=null):e.child.last===this?(e.child.last=this.sibling.left,t(this.sibling.left,null)):(this.sibling.right.sibling.left=this.sibling.left,t(this.sibling.left,this.sibling.right)),this.sibling.left=null,t(this,null),this.parent=null}addEventListener(t,e,i){}removeEventListener(t,e,i){}setAttribute(t,e){this.attributes[s(t)]=n(e)}removeAttribute(t){delete this.attributes[s(t)]}replaceWith(e){if(!this.parent)return;let{parent:i}=this;e.parent&&e.remove(),i.child.first===this&&i.child.last===this?(i.firstChild=e,i.child.first=e,i.child.last=e):i.child.first===this?(i.child.first=e,i.firstChild=e,this.sibling.right.sibling.left=e):i.child.last===this?(i.child.last=e,t(this.sibling.left,e)):(this.sibling.right.sibling.left=e,t(this.sibling.left,e)),e.sibling.left=this.sibling.left,t(e,this.sibling.right),e.parent=i,this.sibling.left=null,t(this,null),this.parent=null}replaceData(t,e,i){'string'==typeof this.textContent&&(this.textContent=`${this.textContent.slice(0,t)}${i}${this.textContent.slice(t+e)}`)}splitText(t){if('string'!=typeof this.textContent)return null;let e=new o;return e.nodeName='#text',e.textContent=this.textContent.slice(t),this.textContent=this.textContent.slice(0,t),this.after(e),e}}class u{constructor(){this.properties=Object.create(null)}setProperty(t,e){this.properties[s(t)]=n(e)}removeProperty(t){delete this.properties[s(t)]}}const g=['area','base','br','col','embed','hr','img','input','keygen','link','meta','param','source','track','wbr'];exports.renderStatic=t=>{let l,h={document:{createTextNode(t){let e=new o;return e.textContent=String(t),e.nodeName='#text',e},createElement(t){let e=new o;return e.tagName=s(t),e.isFragment=0,e},createElementNS(t,e){switch(t){case'http://www.w3.org/1999/xhtml':case'http://www.w3.org/2000/svg':break;default:t='http://www.w3.org/1999/xhtml'}let i=new o;return i.tagName=s(e),i.namespaceURI=t,i.isFragment=0,i},createDocumentFragment:()=>new o}},u=h.document.createDocumentFragment();return'object'==typeof t&&null!==t&&(l=t.scope,t=t.fn),new Promise(o=>{r.using(u,{fn:t,env:h,scope:l,onComplete(){o(function(t){let r=[];(function t(r,l){if(null!==r.textContent){let t=r.textContent;r.parent&&'script'===r.parent.tagName||(t=String(t).replace(c,i)),l.push(t)}if(r.isFragment){let e=r.firstChild;for(;e;)t(e,l),e=e.sibling.right;return}l.push('<',r.tagName);for(let t in r.attributes)l.push(' ',t,'=','"',n(r.attributes[t]),'"');for(let t in r.dataset)l.push(' ','data-',s(t).replace(a,e),'=','"',n(r.dataset[t]),'"');let h=[];for(let t in r.style.properties)if(t.startsWith('--'))h.push(`${t}: ${r.style.properties[t]}`);else{let e=t.replace(/[A-Z]/g,t=>"-"+t.toLowerCase());(t.startsWith('webkit')||t.startsWith('moz'))&&(e="-"+e),h.push(`${e}: ${r.style.properties[t]}`)}if(h.length>0&&l.push(' ','style','=','"',h.join(';'),'"'),l.push('>'),g.includes(r.tagName))return;let o=r.firstChild;for(;o;)t(o,l),o=o.sibling.right;l.push('</',r.tagName,'>')})(t,r);let l=r.join('');return function t(e){if('html'===e.tagName)return 1;if(e.isFragment&&null===e.textContent){let i=e.firstChild;if(i&&e.child.last===i)return t(i)}return 0}(t)?"<!DOCTYPE html>"+l:l}(u))}})})};
//# sourceMappingURL=server.js.map

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc