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.16.8 to 0.16.9

2

package.json
{
"name": "forest",
"version": "0.16.8",
"version": "0.16.9",
"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={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}},a=n.document.createDocumentFragment();return new Promise(i=>{l.using(a,{fn:t,env: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})(a))}})})};
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={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}},a=n.document.createDocumentFragment();return new Promise(i=>{l.using(a,{fn:t,env: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})(a))}})})};
//# sourceMappingURL=server.js.map

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