Comparing version 3.8.1 to 3.9.0
@@ -1,1 +0,1 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});let{round:e,floor:t,max:r}=Math,n=e=>{let[,t]=/([a-f\d]{3,6})/i.exec(e)||[],r=t?t.length:0;if(3===r)t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2];else if(6!==r)return[0,0,0];let n=parseInt(t,16);return[n>>16&255,n>>8&255,255&n]},i=(t,r,n)=>t===r&&r===n?t<8?16:t>248?231:e((t-8)/247*24)+232:16+36*e(t/51)+6*e(r/51)+e(n/51),l=n=>{let i,l,o,s,a;return n<8?30+n:n<16?n-8+90:(n>=232?i=l=o=(10*(n-232)+8)/255:(a=(n-=16)%36,i=t(n/36)/5,l=t(a/6)/5,o=a%6/5),s=2*r(i,l,o),s?30+(e(o)<<2|e(l)<<1|e(i))+(2===s?60:0):30)},o=(()=>{let e=e=>l.some((t=>e.test(t))),t=globalThis,r=t.Deno,n=!!r,i=t.process||r||{},l=i.argv||i.args||[],o=i.env||{},s=-1;if(n)try{o=o.toObject()}catch(e){s=0}let a=!!o.PM2_HOME&&!!o.pm_id||o.NEXT_RUNTIME?.includes("edge")||(n?r.isatty(1):!!i.stdout?.isTTY),c="FORCE_COLOR",u=o[c],p=parseInt(u),f=isNaN(p)?"false"===u?0:-1:p,g=c in o&&f||e(/^-{1,2}color=?(true|always)?$/);return g&&(s=f),s<0&&(s=((e,t,r)=>{let{TERM:n,COLORTERM:i}=e;return"truecolor"===i||"24bit"===i?3:"ansi256"===i?2:"ansi"===i||e.TF_BUILD?1:e.TEAMCITY_VERSION?2:e.CI?["GITHUB_ACTIONS","GITEA_ACTIONS"].some((t=>t in e))?3:1:!t||/-mono|dumb/i.test(n)?0:r||/^xterm-(kitty|direct)$/i.test(n)?3:/-256(colou?r)?$/i.test(n)?2:/^screen|^tmux|^xterm|^vt[1-5][0-9]([0-9])?|^ansi|color|cygwin|linux|mintty|rxvt/i.test(n)?1:3})(o,a,"win32"===(n?r.build.os:i.platform))),!f||o.NO_COLOR||e(/^-{1,2}(no-color|color=(false|never))$/)?0:g&&0===s?3:s})(),s=o>0,a={open:"",close:""},c=s?(e,t)=>({open:`[${e}m`,close:`[${t}m`}):()=>a,u=39,p=49,f=(e,t)=>(r,n,o)=>c(((e,t,r)=>l(i(e,t,r)))(r,n,o)+e,t),g=e=>(t,r,n)=>e(i(t,r,n)),d=e=>t=>{let[r,i,l]=n(t);return e(r,i,l)},b=e=>c(`38;5;${e}`,u),_=e=>c(`48;5;${e}`,p),O=(e,t,r)=>c(`38;2;${e};${t};${r}`,u),m=(e,t,r)=>c(`48;2;${e};${t};${r}`,p);1===o?(b=e=>c(l(e),u),_=e=>c(l(e)+10,p),O=f(0,u),m=f(10,p)):2===o&&(O=g(b),m=g(_));let x,y,$={ansi256:b,bgAnsi256:_,fg:b,bg:_,rgb:O,bgRgb:m,hex:d(O),bgHex:d(m),visible:a,reset:c(0,0),bold:c(1,22),dim:c(2,22),italic:c(3,23),underline:c(4,24),inverse:c(7,27),hidden:c(8,28)},h="black,red,green,yellow,blue,magenta,cyan,white".split(","),T="Bright",I=30;for(x of h)y="bg"+x[0].toUpperCase()+x.slice(1),$[x]=c(I,u),$[x+T]=c(I+60,u),$[y]=c(I+10,p),$[y+T]=c(I+70,p),I++;$.grey=$.gray=c(90,u),$.bgGrey=$.bgGray=c(100,p),$.strikethrough=$.strike=c(9,29);let R,{create:v,defineProperty:C,setPrototypeOf:E}=Object,w={},M=({_p:e},{open:t,close:r})=>{let n=(e,...t)=>{if(""===e)return e;let r=n._p,{_a:i,_b:l}=r,o=e?.raw?String.raw(e,...t):""+e;if(~o.indexOf(""))for(;r;){let e,t=r.close,n=r.open,i=t.length,l="",s=0;if(i){for(;~(e=o.indexOf(t,s));s=e+i)l+=o.slice(s,e)+n;o=l+o.slice(s)}r=r._p}return~o.indexOf("\n")&&(o=o.replace(/(\r?\n)/g,l+"$1"+i)),i+o+l},i=t,l=r;return e&&(i=e._a+t,l=r+e._b),E(n,R),n._p={open:t,close:r,_a:i,_b:l,_p:e},n.open=i,n.close=l,n};const N=function(){let e={isSupported:()=>s,strip:e=>e.replace(/[][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g,""),extend(t){for(let e in t){let r=t[e],i=(typeof r)[0],l="s"===i?O(...n(r)):r;w[e]="f"===i?{get(){return(...e)=>M(this,r(...e))}}:{get(){let t=M(this,l);return C(this,e,{value:t}),t}}}return R=v({},w),E(e,R),e}};return e.extend($)},A=new N;module.exports=A,module.exports.Ansis=N,A.default=A; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});let{round:e,floor:t,max:r}=Math,n=e=>{let[,t]=/([a-f\d]{3,6})/i.exec(e)||[],r=t?t.length:0;if(3===r)t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2];else if(6!==r)return[0,0,0];let n=parseInt(t,16);return[n>>16&255,n>>8&255,255&n]},l=(t,r,n)=>t===r&&r===n?t<8?16:t>248?231:e((t-8)/247*24)+232:16+36*e(t/51)+6*e(r/51)+e(n/51),i=n=>{let l,i,o,s,a;return n<8?30+n:n<16?n-8+90:(n>=232?l=i=o=(10*(n-232)+8)/255:(a=(n-=16)%36,l=t(n/36)/5,i=t(a/6)/5,o=a%6/5),s=2*r(l,i,o),s?30+(e(o)<<2|e(i)<<1|e(l))+(2===s?60:0):30)},o=(()=>{let e=e=>i.some((t=>e.test(t))),t=globalThis,r=t.Deno,n=!!r,l=t.process||r||{},i=l.argv||l.args||[],o=l.env||{},s=-1;if(n)try{o=o.toObject()}catch(e){s=0}let a=!!o.PM2_HOME&&!!o.pm_id||o.NEXT_RUNTIME?.includes("edge")||(n?r.isatty(1):!!l.stdout?.isTTY),c="FORCE_COLOR",u=o[c],p=parseInt(u),f=isNaN(p)?"false"===u?0:-1:p,g=c in o&&f||e(/^-{1,2}color=?(true|always)?$/);return g&&(s=f),s<0&&(s=((e,t,r)=>{let{TERM:n,COLORTERM:l}=e;return"truecolor"===l||"24bit"===l?3:"ansi256"===l?2:"ansi"===l||e.TF_BUILD?1:e.TEAMCITY_VERSION?2:e.CI?["GITHUB_ACTIONS","GITEA_ACTIONS"].some((t=>t in e))?3:1:!t||/-mono|dumb/i.test(n)?0:r||/^xterm-(kitty|direct)$/i.test(n)?3:/-256(colou?r)?$/i.test(n)?2:/^screen|^tmux|^xterm|^vt[1-5][0-9]([0-9])?|^ansi|color|cygwin|linux|mintty|rxvt/i.test(n)?1:3})(o,a,"win32"===(n?r.build.os:l.platform))),!f||o.NO_COLOR||e(/^-{1,2}(no-color|color=(false|never))$/)?0:g&&0===s?3:s})(),s=o>0,a={open:"",close:""},c=s?(e,t)=>({open:`[${e}m`,close:`[${t}m`}):()=>a,u=39,p=49,f=(e,t)=>(r,n,o)=>c(((e,t,r)=>i(l(e,t,r)))(r,n,o)+e,t),g=e=>(t,r,n)=>e(l(t,r,n)),d=e=>t=>{let[r,l,i]=n(t);return e(r,l,i)},b=e=>c(`38;5;${e}`,u),_=e=>c(`48;5;${e}`,p),O=(e,t,r)=>c(`38;2;${e};${t};${r}`,u),m=(e,t,r)=>c(`48;2;${e};${t};${r}`,p);1===o?(b=e=>c(i(e),u),_=e=>c(i(e)+10,p),O=f(0,u),m=f(10,p)):2===o&&(O=g(b),m=g(_));let x,y,$={ansi256:b,bgAnsi256:_,fg:b,bg:_,rgb:O,bgRgb:m,hex:d(O),bgHex:d(m),visible:a,reset:c(0,0),bold:c(1,22),dim:c(2,22),italic:c(3,23),underline:c(4,24),inverse:c(7,27),hidden:c(8,28)},h="black,red,green,yellow,blue,magenta,cyan,white".split(","),T="Bright",I=30;for(x of h)y="bg"+x[0].toUpperCase()+x.slice(1),$[x]=c(I,u),$[x+T]=c(I+60,u),$[y]=c(I+10,p),$[y+T]=c(I+70,p),I++;$.grey=$.gray=c(90,u),$.bgGrey=$.bgGray=c(100,p),$.strikethrough=$.strike=c(9,29);let R,{create:v,defineProperty:C,setPrototypeOf:E}=Object,w={},M=({_p:e},{open:t,close:r})=>{let n=(e,...t)=>{if(null==e||""===e)return"";let r=n._p,{_a:l,_b:i}=r,o=e?.raw?String.raw(e,...t):""+e;if(~o.indexOf(""))for(;r;){let e,t=r.close,n=r.open,l=t.length,i="",s=0;if(l){for(;~(e=o.indexOf(t,s));s=e+l)i+=o.slice(s,e)+n;o=i+o.slice(s)}r=r._p}return~o.indexOf("\n")&&(o=o.replace(/(\r?\n)/g,i+"$1"+l)),l+o+i},l=t,i=r;return e&&(l=e._a+t,i=r+e._b),E(n,R),n._p={open:t,close:r,_a:l,_b:i,_p:e},n.open=l,n.close=i,n};const N=function(){let e={isSupported:()=>s,strip:e=>e.replace(/[][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g,""),extend(t){for(let e in t){let r=t[e],l=(typeof r)[0],i="s"===l?O(...n(r)):r;w[e]="f"===l?{get(){return(...e)=>M(this,r(...e))}}:{get(){let t=M(this,i);return C(this,e,{value:t}),t}}}return R=v({},w),E(e,R),e}};return e.extend($)},A=new N;module.exports=A,module.exports.Ansis=N,A.default=A; |
{ | ||
"name":"ansis", | ||
"version":"3.8.1", | ||
"version":"3.9.0", | ||
"description":"ANSI colors in terminal output", | ||
@@ -5,0 +5,0 @@ "keywords":["ansi","color","style","terminal","cli"], |
# Ansis | ||
Enable ANSI colors in terminal output. | ||
Enable ANSI colors in terminal output. [Docs on GitHub](https://github.com/webdiscus/ansis). | ||
## 📖 [Docs on GitHub](https://github.com/webdiscus/ansis) | ||
# | ||
![](docs/npm.png) |
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
6773