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

ansis

Package Overview
Dependencies
Maintainers
0
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ansis - npm Package Compare versions

Comparing version 3.5.0-beta.4 to 3.5.0-beta.5

2

index.js

@@ -1,1 +0,1 @@

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

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

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