Comparing version 3.12.0 to 3.14.0
@@ -1,1 +0,1 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});let{round:e,max:t}=Math,r=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]},n=(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=r=>{let n,i,l,s,o;return r<8?30+r:r<16?r-8+90:(r>=232?n=i=l=(10*(r-232)+8)/255:(o=(r-=16)%36,n=(r/36|0)/5,i=(o/6|0)/5,l=o%6/5),s=2*t(n,i,l),s?30+(e(l)<<2|e(i)<<1|e(n))+(2^s?0:60):30)},l=(()=>{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||[],s=i.env||{},o=-1;if(n)try{s=s.toObject()}catch(e){o=0}let a=!!s.PM2_HOME&&!!s.pm_id||s.NEXT_RUNTIME?.includes("edge")||(n?r.isatty(1):!!i.stdout?.isTTY),c="FORCE_COLOR",u=s[c],p=parseInt(u),g=isNaN(p)?"false"===u?0:-1:p,d=c in s&&g||e(/^-{1,2}color=?(true|always)?$/);return d&&(o=g),o<0&&(o=((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})(s,a,"win32"===(n?r.build.os:i.platform))),!g||s.NO_COLOR||e(/^-{1,2}(no-color|color=(false|never))$/)?0:d&&!o?3:o})(),s=l>0,o="",a={open:o,close:o},c=s?(e,t)=>({open:`[${e}m`,close:`[${t}m`}):()=>a,u=39,p=49,g=(e,t)=>(r,l,s)=>c(((e,t,r)=>i(n(e,t,r)))(r,l,s)+e,t),d=e=>(t,r,i)=>e(n(t,r,i)),f=e=>t=>e(...r(t)),b=(e,t,r)=>c(`38;2;${e};${t};${r}`,u),_=(e,t,r)=>c(`48;2;${e};${t};${r}`,p),m=e=>c(`38;5;${e}`,u),O=e=>c(`48;5;${e}`,p);2===l?(b=d(m),_=d(O)):1===l&&(b=g(0,u),_=g(10,p),m=e=>c(i(e),u),O=e=>c(i(e)+10,p));let y,x={ansi256:m,bgAnsi256:O,fg:m,bg:O,rgb:b,bgRgb:_,hex:f(b),bgHex:f(_),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)},$="Bright",h=30;"black,red,green,yellow,blue,magenta,cyan,white".split(",").map((e=>{y="bg"+e[0].toUpperCase()+e.slice(1),x[e]=c(h,u),x[e+$]=c(60+h,u),x[y]=c(h+10,p),x[y+$]=c(70+h++,p)})),x.grey=x.gray=c(90,u),x.bgGrey=x.bgGray=c(100,p),x.strikethrough=x.strike=c(9,29);let T,{create:I,defineProperty:R,setPrototypeOf:v}=Object,C={},E=({_p:e},{open:t,close:r})=>{let n=(e,...i)=>{if(!e){if(t&&t===r)return t;if(null==e||o===e)return o}let l=e.raw?String.raw(e,...i).replace(/\\n/g,"\n"):o+e,s=n._p,{_a:a,_b:c}=s;if(l.includes(""))for(;s;){let e,t=s.close,r=s.open,n=t.length,i=o,a=0;if(n){for(;~(e=l.indexOf(t,a));a=e+n)i+=l.slice(a,e)+r;l=i+l.slice(a)}s=s._p}return l.includes("\n")&&(l=l.replace(/(\r?\n)/g,c+"$1"+a)),a+l+c},i=t,l=r;return e&&(i=e._a+t,l=r+e._b),v(n,T),n._p={open:t,close:r,_a:i,_b:l,_p:e},n.open=i,n.close=l,n};const w=function(){let e={isSupported:()=>s,strip:e=>e.replace(/[][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g,o),extend(t){for(let e in t){let n=t[e],i=(typeof n)[0],l="s"===i?b(...r(n)):n;C[e]="f"===i?{get(){return(...e)=>E(this,n(...e))}}:{get(){let t=E(this,l);return R(this,e,{value:t}),t}}}return T=I({},C),v(e,T),e}};return e.extend(x)},M=new w;module.exports=M,module.exports.Ansis=w,M.default=M; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});let{round:e,max:t}=Math,r=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]},n=(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=r=>{let n,l,s,i,o;return r<8?30+r:r<16?r-8+90:(r>=232?n=l=s=(10*(r-232)+8)/255:(o=(r-=16)%36,n=(r/36|0)/5,l=(o/6|0)/5,s=o%6/5),i=2*t(n,l,s),i?30+(e(s)<<2|e(l)<<1|e(n))+(2^i?0:60):30)},s=(()=>{let e=e=>s.some((t=>e.test(t))),t=globalThis,r=t.Deno,n=!!r,l=t.process||r||{},s=l.argv||l.args||[],i=l.env||{},o=-1;if(n)try{i=i.toObject()}catch(e){o=0}let a=!!i.PM2_HOME&&!!i.pm_id||i.NEXT_RUNTIME?.includes("edge")||(n?r.isatty(1):!!l.stdout?.isTTY),c="FORCE_COLOR",u=i[c],p=parseInt(u),g=isNaN(p)?"false"===u?0:-1:p,d=c in i&&g||e(/^-{1,2}color=?(true|always)?$/);return d&&(o=g),o<0&&(o=((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||/term-(kit|dir)/.test(n)?3:/-256/.test(n)?2:/scr|xterm|tty|ansi|color|[nm]ux|vt|cyg/.test(n)?1:3})(i,a,"win32"===(n?r.build.os:l.platform))),!g||i.NO_COLOR||e(/^-{1,2}(no-color|color=(false|never))$/)?0:d&&!o||t.window?.chrome?3:o})(),i=s>0,o="",a={open:o,close:o},c=i?(e,t)=>({open:`[${e}m`,close:`[${t}m`}):()=>a,u=39,p=49,g=(e,t)=>(r,s,i)=>c(((e,t,r)=>l(n(e,t,r)))(r,s,i)+e,t),d=e=>(t,r,l)=>e(n(t,r,l)),f=e=>t=>e(...r(t)),b=(e,t,r)=>c(`38;2;${e};${t};${r}`,u),_=(e,t,r)=>c(`48;2;${e};${t};${r}`,p),m=e=>c(`38;5;${e}`,u),O=e=>c(`48;5;${e}`,p);2===s?(b=d(m),_=d(O)):1===s&&(b=g(0,u),_=g(10,p),m=e=>c(l(e),u),O=e=>c(l(e)+10,p));let y,h={ansi256:m,bgAnsi256:O,fg:m,bg:O,rgb:b,bgRgb:_,hex:f(b),bgHex:f(_),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)},T="Bright",$=30;"black,red,green,yellow,blue,magenta,cyan,white".split(",").map((e=>{y="bg"+e[0].toUpperCase()+e.slice(1),h[e]=c($,u),h[e+T]=c(60+$,u),h[y]=c($+10,p),h[y+T]=c(70+$++,p)})),h.grey=h.gray=c(90,u),h.bgGrey=h.bgGray=c(100,p),h.strikethrough=h.strike=c(9,29);let x,{create:I,defineProperty:R,setPrototypeOf:w}=Object,C={},E=({_p:e},{open:t,close:r})=>{let n=(e,...l)=>{if(!e){if(t&&t===r)return t;if(null==e||o===e)return o}let s=e.raw?String.raw(e,...l).replace(/\\n/g,"\n"):o+e,i=n._p,{_a:a,_b:c}=i;if(s.includes(""))for(;i;){let e,t=i.close,r=i.open,n=t.length,l=o,a=0;if(n){for(;~(e=s.indexOf(t,a));a=e+n)l+=s.slice(a,e)+r;s=l+s.slice(a)}i=i._p}return s.includes("\n")&&(s=s.replace(/(\r?\n)/g,c+"$1"+a)),a+s+c},l=t,s=r;return e&&(l=e._a+t,s=r+e._b),w(n,x),n._p={open:t,close:r,_a:l,_b:s,_p:e},n.open=l,n.close=s,n};const v=function(){let e={isSupported:()=>i,strip:e=>e.replace(/[][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g,o),extend(t){for(let e in t){let n=t[e],l=(typeof n)[0],s="s"===l?b(...r(n)):n;C[e]="f"===l?{get(){return(...e)=>E(this,n(...e))}}:{get(){let t=E(this,s);return R(this,e,{value:t}),t}}}return x=I({},C),w(e,x),e}};return e.extend(h)},M=new v;module.exports=M,module.exports.Ansis=v,M.default=M; |
{ | ||
"name":"ansis", | ||
"version":"3.12.0", | ||
"description":"ANSI colors in terminal output", | ||
"version":"3.14.0", | ||
"description":"ANSI colors in terminal", | ||
"keywords":["ansi","color","style","terminal","cli"], | ||
@@ -6,0 +6,0 @@ "license":"ISC", |
# Ansis | ||
Enable ANSI colors in terminal output. [Docs on GitHub](https://github.com/webdiscus/ansis). | ||
Enable ANSI colors in terminal. [Docs on GitHub](https://github.com/webdiscus/ansis). | ||
@@ -5,0 +5,0 @@ # |
6722