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

generate-atomic-css

Package Overview
Dependencies
Maintainers
1
Versions
118
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

generate-atomic-css - npm Package Compare versions

Comparing version 3.0.17 to 3.0.18

4

dist/generate-atomic-css.esm.js
/**
* @name generate-atomic-css
* @fileoverview Generate Atomic CSS
* @version 3.0.17
* @version 3.0.18
* @author Roy Revelt, Codsen Ltd

@@ -10,3 +10,3 @@ * @license MIT

import{left as N,right as g}from"string-left-right";var J="3.0.17";import{left as O,right as b,leftSeq as x,rightSeq as L}from"string-left-right";import{isStr as P}from"codsen-utils";var F={CONFIGHEAD:"GENERATE-ATOMIC-CSS-CONFIG-STARTS",CONFIGTAIL:"GENERATE-ATOMIC-CSS-CONFIG-ENDS",CONTENTHEAD:"GENERATE-ATOMIC-CSS-CONTENT-STARTS",CONTENTTAIL:"GENERATE-ATOMIC-CSS-CONTENT-ENDS"},w=["px","em","%","rem","cm","mm","in","pt","pc","ex","ch","vw","vmin","vmax"],{CONFIGHEAD:T,CONFIGTAIL:S,CONTENTHEAD:E,CONTENTTAIL:h}=F,M=[":"];function W(e){let u=e,c="",d="";if(e.includes(T)&&e.includes(S)){if(e.indexOf(S)!==-1&&e.indexOf(E)!==-1&&e.indexOf(S)>e.indexOf(E))throw new Error("generate-atomic-css: [THROW_ID_02] Config heads are after config tails!");let s=e.indexOf(T)+T.length,l=e.indexOf(S);if(e[b(e,s)]==="*"&&e[b(e,b(e,s))]==="/"&&(s=b(e,b(e,s))+1),e[O(e,l)]==="*"&&e[O(e,O(e,l))]==="/"&&(l=O(e,O(e,l))),u=e.slice(s,l).trim(),!P(u)||!u.trim().length)return[u,c,d]}else if(e.includes(T)&&!e.includes(S)&&e.includes(E)){if(e.indexOf(T)>e.indexOf(E))throw new Error("generate-atomic-css: [THROW_ID_03] Config heads are after content heads!");u=e.slice(e.indexOf(T)+T.length,e.indexOf(E))}else if(!e.includes(T)&&!e.includes(S)&&(e.includes(E)||e.includes(h))){if(u=e,u.includes(E)){if(O(e,u.indexOf(E))){let o=u.indexOf(E);x(e,o,"/","*")&&(o=x(e,o,"/","*").leftmostChar),c=o===0?"":e.slice(0,o)}let s=u.indexOf(E)+E.length;L(u,s-1,"*","/")&&(s=L(u,s-1,"*","/").rightmostChar+1);let l=null;if(e.includes(h)){l=e.indexOf(h),e[O(e,l)]==="*"&&e[O(e,O(e,l))]==="/"&&(l=O(e,O(e,l)));let o=e.indexOf(h)+h.length;e[b(e,o-1)]==="*"&&e[b(e,b(e,o-1))]==="/"&&(o=b(e,b(e,o-1))+1),b(e,o)&&(d=e.slice(o))}l?u=u.slice(s,l).trim():u=u.slice(s).trim()}else if(u.includes(h)){let s=[],l=!1;u=u.split(`
import{left as N,right as g}from"string-left-right";var J="3.0.18";import{left as O,right as b,leftSeq as x,rightSeq as L}from"string-left-right";import{isStr as P}from"codsen-utils";var F={CONFIGHEAD:"GENERATE-ATOMIC-CSS-CONFIG-STARTS",CONFIGTAIL:"GENERATE-ATOMIC-CSS-CONFIG-ENDS",CONTENTHEAD:"GENERATE-ATOMIC-CSS-CONTENT-STARTS",CONTENTTAIL:"GENERATE-ATOMIC-CSS-CONTENT-ENDS"},w=["px","em","%","rem","cm","mm","in","pt","pc","ex","ch","vw","vmin","vmax"],{CONFIGHEAD:T,CONFIGTAIL:S,CONTENTHEAD:E,CONTENTTAIL:h}=F,M=[":"];function W(e){let u=e,c="",d="";if(e.includes(T)&&e.includes(S)){if(e.indexOf(S)!==-1&&e.indexOf(E)!==-1&&e.indexOf(S)>e.indexOf(E))throw new Error("generate-atomic-css: [THROW_ID_02] Config heads are after config tails!");let s=e.indexOf(T)+T.length,l=e.indexOf(S);if(e[b(e,s)]==="*"&&e[b(e,b(e,s))]==="/"&&(s=b(e,b(e,s))+1),e[O(e,l)]==="*"&&e[O(e,O(e,l))]==="/"&&(l=O(e,O(e,l))),u=e.slice(s,l).trim(),!P(u)||!u.trim().length)return[u,c,d]}else if(e.includes(T)&&!e.includes(S)&&e.includes(E)){if(e.indexOf(T)>e.indexOf(E))throw new Error("generate-atomic-css: [THROW_ID_03] Config heads are after content heads!");u=e.slice(e.indexOf(T)+T.length,e.indexOf(E))}else if(!e.includes(T)&&!e.includes(S)&&(e.includes(E)||e.includes(h))){if(u=e,u.includes(E)){if(O(e,u.indexOf(E))){let o=u.indexOf(E);x(e,o,"/","*")&&(o=x(e,o,"/","*").leftmostChar),c=o===0?"":e.slice(0,o)}let s=u.indexOf(E)+E.length;L(u,s-1,"*","/")&&(s=L(u,s-1,"*","/").rightmostChar+1);let l=null;if(e.includes(h)){l=e.indexOf(h),e[O(e,l)]==="*"&&e[O(e,O(e,l))]==="/"&&(l=O(e,O(e,l)));let o=e.indexOf(h)+h.length;e[b(e,o-1)]==="*"&&e[b(e,b(e,o-1))]==="/"&&(o=b(e,b(e,o-1))+1),b(e,o)&&(d=e.slice(o))}l?u=u.slice(s,l).trim():u=u.slice(s).trim()}else if(u.includes(h)){let s=[],l=!1;u=u.split(`
`).filter(i=>!i.includes("$$$")&&!l?(l||s.push(i),!1):(l||(l=!0),!0)).join(`

@@ -13,0 +13,0 @@ `);let o=u.indexOf(h);x(u,o,"/","*")&&(o=x(u,o,"/","*").leftmostChar),u=u.slice(0,o).trim(),s.length&&(c=`${s.join(`

/**
* @name generate-atomic-css
* @fileoverview Generate Atomic CSS
* @version 3.0.17
* @version 3.0.18
* @author Roy Revelt, Codsen Ltd

@@ -16,3 +16,3 @@ * @license MIT

\r`.includes(e[n-2])||f&&e[n-2]===v))return n-2;for(let t=n;t--;)if(e[t]&&(e[t].trim()||o&&`
\r`.includes(e[t])||f&&e[t]===v))return t;return null}function h(e,n=0){return $e({str:e,idx:n,stopAtNewlines:!1,stopAtRawNbsp:!1})}function X(e,n,o,f,t){if(typeof n!="string"||!n.length||(typeof o!="number"&&(o=0),e==="right"&&!n[o+1]||e==="left"&&!n[~-o]))return null;let l=o,i=[],r,s,u,a=0;for(;a<t.length;){if(!C(t[a])||!t[a].length){a+=1;continue}let{value:b,optional:g,hungry:$}=ce(t[a]),p=e==="right"?m(n,l):h(n,l);if(f.i&&n[p].toLowerCase()===b.toLowerCase()||!f.i&&n[p]===b){let c=e==="right"?m(n,p):h(n,p);$&&(f.i&&n[c].toLowerCase()===b.toLowerCase()||!f.i&&n[c]===b)?u=!0:a+=1,typeof p=="number"&&e==="right"&&p>l+1?i.push([l+1,p]):e==="left"&&typeof p=="number"&&p<~-l&&i.unshift([p+1,l]),l=p,e==="right"?(r===void 0&&(r=p),s=p):(s===void 0&&(s=p),r=p)}else if(g){a+=1;continue}else if(u){a+=1,u=void 0;continue}else return null}return r===void 0||s===void 0?null:{gaps:i,leftmostChar:r,rightmostChar:s}}var F={i:!1};function x(e,n,...o){if(!(o!=null&&o.length))throw new Error("string-left-right/leftSeq(): only two input arguments were passed! Did you intend to use left() method instead?");let f;return R(o[0])?f=w(w({},F),o.shift()):f=F,X("left",e,n,f,Array.from(o).reverse())}function j(e,n,...o){if(!(o!=null&&o.length))throw new Error("string-left-right/rightSeq(): only two input arguments were passed! Did you intend to use right() method instead?");let f;return R(o[0])?f=w(w({},F),o.shift()):f=F,X("right",e,n,f,o)}var Y="3.0.17";var L={CONFIGHEAD:"GENERATE-ATOMIC-CSS-CONFIG-STARTS",CONFIGTAIL:"GENERATE-ATOMIC-CSS-CONFIG-ENDS",CONTENTHEAD:"GENERATE-ATOMIC-CSS-CONTENT-STARTS",CONTENTTAIL:"GENERATE-ATOMIC-CSS-CONTENT-ENDS"},I=["px","em","%","rem","cm","mm","in","pt","pc","ex","ch","vw","vmin","vmax"],{CONFIGHEAD:S,CONFIGTAIL:N,CONTENTHEAD:E,CONTENTTAIL:y}=L,de=[":"];function k(e){let n=e,o="",f="";if(e.includes(S)&&e.includes(N)){if(e.indexOf(N)!==-1&&e.indexOf(E)!==-1&&e.indexOf(N)>e.indexOf(E))throw new Error("generate-atomic-css: [THROW_ID_02] Config heads are after config tails!");let t=e.indexOf(S)+S.length,l=e.indexOf(N);if(e[m(e,t)]==="*"&&e[m(e,m(e,t))]==="/"&&(t=m(e,m(e,t))+1),e[h(e,l)]==="*"&&e[h(e,h(e,l))]==="/"&&(l=h(e,h(e,l))),n=e.slice(t,l).trim(),!C(n)||!n.trim().length)return[n,o,f]}else if(e.includes(S)&&!e.includes(N)&&e.includes(E)){if(e.indexOf(S)>e.indexOf(E))throw new Error("generate-atomic-css: [THROW_ID_03] Config heads are after content heads!");n=e.slice(e.indexOf(S)+S.length,e.indexOf(E))}else if(!e.includes(S)&&!e.includes(N)&&(e.includes(E)||e.includes(y))){if(n=e,n.includes(E)){if(h(e,n.indexOf(E))){let i=n.indexOf(E);x(e,i,"/","*")&&(i=x(e,i,"/","*").leftmostChar),o=i===0?"":e.slice(0,i)}let t=n.indexOf(E)+E.length;j(n,t-1,"*","/")&&(t=j(n,t-1,"*","/").rightmostChar+1);let l=null;if(e.includes(y)){l=e.indexOf(y),e[h(e,l)]==="*"&&e[h(e,h(e,l))]==="/"&&(l=h(e,h(e,l)));let i=e.indexOf(y)+y.length;e[m(e,i-1)]==="*"&&e[m(e,m(e,i-1))]==="/"&&(i=m(e,m(e,i-1))+1),m(e,i)&&(f=e.slice(i))}l?n=n.slice(t,l).trim():n=n.slice(t).trim()}else if(n.includes(y)){let t=[],l=!1;n=n.split(`
\r`.includes(e[t])||f&&e[t]===v))return t;return null}function h(e,n=0){return $e({str:e,idx:n,stopAtNewlines:!1,stopAtRawNbsp:!1})}function X(e,n,o,f,t){if(typeof n!="string"||!n.length||(typeof o!="number"&&(o=0),e==="right"&&!n[o+1]||e==="left"&&!n[~-o]))return null;let l=o,i=[],r,s,u,a=0;for(;a<t.length;){if(!C(t[a])||!t[a].length){a+=1;continue}let{value:b,optional:g,hungry:$}=ce(t[a]),p=e==="right"?m(n,l):h(n,l);if(f.i&&n[p].toLowerCase()===b.toLowerCase()||!f.i&&n[p]===b){let c=e==="right"?m(n,p):h(n,p);$&&(f.i&&n[c].toLowerCase()===b.toLowerCase()||!f.i&&n[c]===b)?u=!0:a+=1,typeof p=="number"&&e==="right"&&p>l+1?i.push([l+1,p]):e==="left"&&typeof p=="number"&&p<~-l&&i.unshift([p+1,l]),l=p,e==="right"?(r===void 0&&(r=p),s=p):(s===void 0&&(s=p),r=p)}else if(g){a+=1;continue}else if(u){a+=1,u=void 0;continue}else return null}return r===void 0||s===void 0?null:{gaps:i,leftmostChar:r,rightmostChar:s}}var F={i:!1};function x(e,n,...o){if(!(o!=null&&o.length))throw new Error("string-left-right/leftSeq(): only two input arguments were passed! Did you intend to use left() method instead?");let f;return R(o[0])?f=w(w({},F),o.shift()):f=F,X("left",e,n,f,Array.from(o).reverse())}function j(e,n,...o){if(!(o!=null&&o.length))throw new Error("string-left-right/rightSeq(): only two input arguments were passed! Did you intend to use right() method instead?");let f;return R(o[0])?f=w(w({},F),o.shift()):f=F,X("right",e,n,f,o)}var Y="3.0.18";var L={CONFIGHEAD:"GENERATE-ATOMIC-CSS-CONFIG-STARTS",CONFIGTAIL:"GENERATE-ATOMIC-CSS-CONFIG-ENDS",CONTENTHEAD:"GENERATE-ATOMIC-CSS-CONTENT-STARTS",CONTENTTAIL:"GENERATE-ATOMIC-CSS-CONTENT-ENDS"},I=["px","em","%","rem","cm","mm","in","pt","pc","ex","ch","vw","vmin","vmax"],{CONFIGHEAD:S,CONFIGTAIL:N,CONTENTHEAD:E,CONTENTTAIL:y}=L,de=[":"];function k(e){let n=e,o="",f="";if(e.includes(S)&&e.includes(N)){if(e.indexOf(N)!==-1&&e.indexOf(E)!==-1&&e.indexOf(N)>e.indexOf(E))throw new Error("generate-atomic-css: [THROW_ID_02] Config heads are after config tails!");let t=e.indexOf(S)+S.length,l=e.indexOf(N);if(e[m(e,t)]==="*"&&e[m(e,m(e,t))]==="/"&&(t=m(e,m(e,t))+1),e[h(e,l)]==="*"&&e[h(e,h(e,l))]==="/"&&(l=h(e,h(e,l))),n=e.slice(t,l).trim(),!C(n)||!n.trim().length)return[n,o,f]}else if(e.includes(S)&&!e.includes(N)&&e.includes(E)){if(e.indexOf(S)>e.indexOf(E))throw new Error("generate-atomic-css: [THROW_ID_03] Config heads are after content heads!");n=e.slice(e.indexOf(S)+S.length,e.indexOf(E))}else if(!e.includes(S)&&!e.includes(N)&&(e.includes(E)||e.includes(y))){if(n=e,n.includes(E)){if(h(e,n.indexOf(E))){let i=n.indexOf(E);x(e,i,"/","*")&&(i=x(e,i,"/","*").leftmostChar),o=i===0?"":e.slice(0,i)}let t=n.indexOf(E)+E.length;j(n,t-1,"*","/")&&(t=j(n,t-1,"*","/").rightmostChar+1);let l=null;if(e.includes(y)){l=e.indexOf(y),e[h(e,l)]==="*"&&e[h(e,h(e,l))]==="/"&&(l=h(e,h(e,l)));let i=e.indexOf(y)+y.length;e[m(e,i-1)]==="*"&&e[m(e,m(e,i-1))]==="/"&&(i=m(e,m(e,i-1))+1),m(e,i)&&(f=e.slice(i))}l?n=n.slice(t,l).trim():n=n.slice(t).trim()}else if(n.includes(y)){let t=[],l=!1;n=n.split(`
`).filter(s=>!s.includes("$$$")&&!l?(l||t.push(s),!1):(l||(l=!0),!0)).join(`

@@ -39,3 +39,3 @@ `);let i=n.indexOf(y);x(n,i,"/","*")&&(i=x(n,i,"/","*").leftmostChar),n=n.slice(0,i).trim(),t.length&&(o=`${t.join(`

* @fileoverview Various utility functions
* @version 1.6.3
* @version 1.6.4
* @author Roy Revelt, Codsen Ltd

@@ -48,3 +48,3 @@ * @license MIT

* @fileoverview Looks up the first non-whitespace character to the left/right of a given index
* @version 6.0.16
* @version 6.0.17
* @author Roy Revelt, Codsen Ltd

@@ -51,0 +51,0 @@ * @license MIT

{
"name": "generate-atomic-css",
"version": "3.0.17",
"version": "3.0.18",
"description": "Generate Atomic CSS",

@@ -73,5 +73,5 @@ "keywords": [

"dependencies": {
"codsen-utils": "^1.6.3",
"string-left-right": "^6.0.16"
"codsen-utils": "^1.6.4",
"string-left-right": "^6.0.17"
}
}
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