generate-atomic-css
Advanced tools
Comparing version 2.2.3 to 2.2.4
@@ -14,3 +14,3 @@ # Change Log | ||
### Bug Fixes | ||
### Fixed | ||
@@ -21,3 +21,3 @@ - tweak types ([abf7641](https://github.com/codsen/codsen/commit/abf76412cc8669f04481bdc17c26350b030a8389)) | ||
### Bug Fixes | ||
### Fixed | ||
@@ -54,3 +54,3 @@ - use Partial, every opts key is optional ([844685c](https://github.com/codsen/codsen/commit/844685ca133e107bb10c46c75c6cba70a7a5a8f3)) | ||
### Bug Fixes | ||
### Fixed | ||
@@ -71,3 +71,3 @@ - add testStats to npmignore ([f3c84e9](https://github.com/codsen/codsen/commit/f3c84e95afc5514214312f913692d85b2e12eb29)) | ||
### Bug Fixes | ||
### Fixed | ||
@@ -87,3 +87,3 @@ - closing curlies were not recognised if they were placed on a new line - fixed now ([c81eb14](https://gitlab.com/codsen/codsen/commit/c81eb14)) | ||
### Bug Fixes | ||
### Fixed | ||
@@ -90,0 +90,0 @@ - Don't close the comment blocks above, it's not fully safe ([5ce6230](https://gitlab.com/codsen/codsen/commit/5ce6230)) |
/** | ||
* @name generate-atomic-css | ||
* @fileoverview Generate Atomic CSS | ||
* @version 2.2.3 | ||
* @version 2.2.4 | ||
* @author Roy Revelt, Codsen Ltd | ||
@@ -10,3 +10,3 @@ * @license MIT | ||
import{left as S,right as m}from"string-left-right";var J="2.2.3";import{left as O,right as b,leftSeq as w,rightSeq as L}from"string-left-right";function P(e){return typeof e=="string"}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"},x=["px","em","%","rem","cm","mm","in","pt","pc","ex","ch","vw","vmin","vmax"],{CONFIGHEAD:T,CONFIGTAIL:A,CONTENTHEAD:E,CONTENTTAIL:h}=F,H=[":"];function W(e){let u=e,c="",d="";if(e.includes(T)&&e.includes(A)){if(e.indexOf(A)!==-1&&e.indexOf(E)!==-1&&e.indexOf(A)>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(A);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(A)&&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(A)&&(e.includes(E)||e.includes(h))){if(u=e,u.includes(E)){if(O(e,u.indexOf(E))){let o=u.indexOf(E);w(e,o,"/","*")&&(o=w(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 S,right as m}from"string-left-right";var J="2.2.4";import{left as O,right as b,leftSeq as w,rightSeq as L}from"string-left-right";function P(e){return typeof e=="string"}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"},x=["px","em","%","rem","cm","mm","in","pt","pc","ex","ch","vw","vmin","vmax"],{CONFIGHEAD:T,CONFIGTAIL:A,CONTENTHEAD:E,CONTENTTAIL:h}=F,H=[":"];function W(e){let u=e,c="",d="";if(e.includes(T)&&e.includes(A)){if(e.indexOf(A)!==-1&&e.indexOf(E)!==-1&&e.indexOf(A)>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(A);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(A)&&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(A)&&(e.includes(E)||e.includes(h))){if(u=e,u.includes(E)){if(O(e,u.indexOf(E))){let o=u.indexOf(E);w(e,o,"/","*")&&(o=w(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);w(u,o,"/","*")&&(o=w(u,o,"/","*").leftmostChar),u=u.slice(0,o).trim(),s.length&&(c=`${s.join(` |
/** | ||
* @name generate-atomic-css | ||
* @fileoverview Generate Atomic CSS | ||
* @version 2.2.3 | ||
* @version 2.2.4 | ||
* @author Roy Revelt, Codsen Ltd | ||
@@ -16,3 +16,3 @@ * @license MIT | ||
\r`.includes(e[t-2])||r&&e[t-2]===L))return t-2;for(let o=t;o--;)if(e[o]&&(e[o].trim()||n&&` | ||
\r`.includes(e[o])||r&&e[o]===L))return o;return null}function y(e,t=0){return Er({str:e,idx:t,stopAtNewlines:!1,stopAtRawNbsp:!1})}function Et(e,t,n,r,o){if(typeof t!="string"||!t.length||(typeof n!="number"&&(n=0),e==="right"&&!t[n+1]||e==="left"&&!t[~-n]))return null;let i=n,l=[],s,c,g,u=0;for(;u<o.length;){if(!pr(o[u])||!o[u].length){u+=1;continue}let{value:p,optional:d,hungry:$}=hr(o[u]),b=e==="right"?f(t,i):y(t,i);if(r.i&&t[b].toLowerCase()===p.toLowerCase()||!r.i&&t[b]===p){let a=e==="right"?f(t,b):y(t,b);$&&(r.i&&t[a].toLowerCase()===p.toLowerCase()||!r.i&&t[a]===p)?g=!0:u+=1,typeof b=="number"&&e==="right"&&b>i+1?l.push([i+1,b]):e==="left"&&typeof b=="number"&&b<~-i&&l.unshift([b+1,i]),i=b,e==="right"?(s===void 0&&(s=b),c=b):(c===void 0&&(c=b),s=b)}else if(d){u+=1;continue}else if(g){u+=1,g=void 0;continue}else return null}return s===void 0||c===void 0?null:{gaps:l,leftmostChar:s,rightmostChar:c}}var z={i:!1};function M(e,t,...n){if(!(n!=null&&n.length))throw new Error("string-left-right/leftSeq(): only two input arguments were passed! Did you intend to use left() method instead?");let r;return(0,he.default)(n[0])?r=S(S({},z),n.shift()):r=z,Et("left",e,t,r,Array.from(n).reverse())}function pe(e,t,...n){if(!(n!=null&&n.length))throw new Error("string-left-right/rightSeq(): only two input arguments were passed! Did you intend to use right() method instead?");let r;return(0,he.default)(n[0])?r=S(S({},z),n.shift()):r=z,Et("right",e,t,r,n)}var Ot="2.2.3";function te(e){return typeof e=="string"}var ne={CONFIGHEAD:"GENERATE-ATOMIC-CSS-CONFIG-STARTS",CONFIGTAIL:"GENERATE-ATOMIC-CSS-CONFIG-ENDS",CONTENTHEAD:"GENERATE-ATOMIC-CSS-CONTENT-STARTS",CONTENTTAIL:"GENERATE-ATOMIC-CSS-CONTENT-ENDS"},ee=["px","em","%","rem","cm","mm","in","pt","pc","ex","ch","vw","vmin","vmax"],{CONFIGHEAD:V,CONFIGTAIL:R,CONTENTHEAD:E,CONTENTTAIL:O}=ne,wr=[":"];function wt(e){let t=e,n="",r="";if(e.includes(V)&&e.includes(R)){if(e.indexOf(R)!==-1&&e.indexOf(E)!==-1&&e.indexOf(R)>e.indexOf(E))throw new Error("generate-atomic-css: [THROW_ID_02] Config heads are after config tails!");let o=e.indexOf(V)+V.length,i=e.indexOf(R);if(e[f(e,o)]==="*"&&e[f(e,f(e,o))]==="/"&&(o=f(e,f(e,o))+1),e[y(e,i)]==="*"&&e[y(e,y(e,i))]==="/"&&(i=y(e,y(e,i))),t=e.slice(o,i).trim(),!te(t)||!t.trim().length)return[t,n,r]}else if(e.includes(V)&&!e.includes(R)&&e.includes(E)){if(e.indexOf(V)>e.indexOf(E))throw new Error("generate-atomic-css: [THROW_ID_03] Config heads are after content heads!");t=e.slice(e.indexOf(V)+V.length,e.indexOf(E))}else if(!e.includes(V)&&!e.includes(R)&&(e.includes(E)||e.includes(O))){if(t=e,t.includes(E)){if(y(e,t.indexOf(E))){let l=t.indexOf(E);M(e,l,"/","*")&&(l=M(e,l,"/","*").leftmostChar),n=l===0?"":e.slice(0,l)}let o=t.indexOf(E)+E.length;pe(t,o-1,"*","/")&&(o=pe(t,o-1,"*","/").rightmostChar+1);let i=null;if(e.includes(O)){i=e.indexOf(O),e[y(e,i)]==="*"&&e[y(e,y(e,i))]==="/"&&(i=y(e,y(e,i)));let l=e.indexOf(O)+O.length;e[f(e,l-1)]==="*"&&e[f(e,f(e,l-1))]==="/"&&(l=f(e,f(e,l-1))+1),f(e,l)&&(r=e.slice(l))}i?t=t.slice(o,i).trim():t=t.slice(o).trim()}else if(t.includes(O)){let o=[],i=!1;t=t.split(` | ||
\r`.includes(e[o])||r&&e[o]===L))return o;return null}function y(e,t=0){return Er({str:e,idx:t,stopAtNewlines:!1,stopAtRawNbsp:!1})}function Et(e,t,n,r,o){if(typeof t!="string"||!t.length||(typeof n!="number"&&(n=0),e==="right"&&!t[n+1]||e==="left"&&!t[~-n]))return null;let i=n,l=[],s,c,g,u=0;for(;u<o.length;){if(!pr(o[u])||!o[u].length){u+=1;continue}let{value:p,optional:d,hungry:$}=hr(o[u]),b=e==="right"?f(t,i):y(t,i);if(r.i&&t[b].toLowerCase()===p.toLowerCase()||!r.i&&t[b]===p){let a=e==="right"?f(t,b):y(t,b);$&&(r.i&&t[a].toLowerCase()===p.toLowerCase()||!r.i&&t[a]===p)?g=!0:u+=1,typeof b=="number"&&e==="right"&&b>i+1?l.push([i+1,b]):e==="left"&&typeof b=="number"&&b<~-i&&l.unshift([b+1,i]),i=b,e==="right"?(s===void 0&&(s=b),c=b):(c===void 0&&(c=b),s=b)}else if(d){u+=1;continue}else if(g){u+=1,g=void 0;continue}else return null}return s===void 0||c===void 0?null:{gaps:l,leftmostChar:s,rightmostChar:c}}var z={i:!1};function M(e,t,...n){if(!(n!=null&&n.length))throw new Error("string-left-right/leftSeq(): only two input arguments were passed! Did you intend to use left() method instead?");let r;return(0,he.default)(n[0])?r=S(S({},z),n.shift()):r=z,Et("left",e,t,r,Array.from(n).reverse())}function pe(e,t,...n){if(!(n!=null&&n.length))throw new Error("string-left-right/rightSeq(): only two input arguments were passed! Did you intend to use right() method instead?");let r;return(0,he.default)(n[0])?r=S(S({},z),n.shift()):r=z,Et("right",e,t,r,n)}var Ot="2.2.4";function te(e){return typeof e=="string"}var ne={CONFIGHEAD:"GENERATE-ATOMIC-CSS-CONFIG-STARTS",CONFIGTAIL:"GENERATE-ATOMIC-CSS-CONFIG-ENDS",CONTENTHEAD:"GENERATE-ATOMIC-CSS-CONTENT-STARTS",CONTENTTAIL:"GENERATE-ATOMIC-CSS-CONTENT-ENDS"},ee=["px","em","%","rem","cm","mm","in","pt","pc","ex","ch","vw","vmin","vmax"],{CONFIGHEAD:V,CONFIGTAIL:R,CONTENTHEAD:E,CONTENTTAIL:O}=ne,wr=[":"];function wt(e){let t=e,n="",r="";if(e.includes(V)&&e.includes(R)){if(e.indexOf(R)!==-1&&e.indexOf(E)!==-1&&e.indexOf(R)>e.indexOf(E))throw new Error("generate-atomic-css: [THROW_ID_02] Config heads are after config tails!");let o=e.indexOf(V)+V.length,i=e.indexOf(R);if(e[f(e,o)]==="*"&&e[f(e,f(e,o))]==="/"&&(o=f(e,f(e,o))+1),e[y(e,i)]==="*"&&e[y(e,y(e,i))]==="/"&&(i=y(e,y(e,i))),t=e.slice(o,i).trim(),!te(t)||!t.trim().length)return[t,n,r]}else if(e.includes(V)&&!e.includes(R)&&e.includes(E)){if(e.indexOf(V)>e.indexOf(E))throw new Error("generate-atomic-css: [THROW_ID_03] Config heads are after content heads!");t=e.slice(e.indexOf(V)+V.length,e.indexOf(E))}else if(!e.includes(V)&&!e.includes(R)&&(e.includes(E)||e.includes(O))){if(t=e,t.includes(E)){if(y(e,t.indexOf(E))){let l=t.indexOf(E);M(e,l,"/","*")&&(l=M(e,l,"/","*").leftmostChar),n=l===0?"":e.slice(0,l)}let o=t.indexOf(E)+E.length;pe(t,o-1,"*","/")&&(o=pe(t,o-1,"*","/").rightmostChar+1);let i=null;if(e.includes(O)){i=e.indexOf(O),e[y(e,i)]==="*"&&e[y(e,y(e,i))]==="/"&&(i=y(e,y(e,i)));let l=e.indexOf(O)+O.length;e[f(e,l-1)]==="*"&&e[f(e,f(e,l-1))]==="/"&&(l=f(e,f(e,l-1))+1),f(e,l)&&(r=e.slice(l))}i?t=t.slice(o,i).trim():t=t.slice(o).trim()}else if(t.includes(O)){let o=[],i=!1;t=t.split(` | ||
`).filter(c=>!c.includes("$$$")&&!i?(i||o.push(c),!1):(i||(i=!0),!0)).join(` | ||
@@ -39,3 +39,3 @@ `);let l=t.indexOf(O);M(t,l,"/","*")&&(l=M(t,l,"/","*").leftmostChar),t=t.slice(0,l).trim(),o.length&&(n=`${o.join(` | ||
* @fileoverview Looks up the first non-whitespace character to the left/right of a given index | ||
* @version 5.1.3 | ||
* @version 5.1.4 | ||
* @author Roy Revelt, Codsen Ltd | ||
@@ -42,0 +42,0 @@ * @license MIT |
{ | ||
"name": "generate-atomic-css", | ||
"version": "2.2.3", | ||
"version": "2.2.4", | ||
"description": "Generate Atomic CSS", | ||
@@ -71,4 +71,4 @@ "keywords": [ | ||
"dependencies": { | ||
"string-left-right": "^5.1.3" | ||
"string-left-right": "^5.1.4" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
42873
Updatedstring-left-right@^5.1.4