@visulima/ansi 1.0.3 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +32 -0
- package/dist/alternative-screen.mjs +1 -1
- package/dist/clear.cjs +1 -1
- package/dist/clear.mjs +1 -1
- package/dist/cursor.cjs +1 -1
- package/dist/cursor.mjs +1 -1
- package/dist/erase.cjs +1 -1
- package/dist/erase.mjs +1 -1
- package/dist/image.cjs +1 -1
- package/dist/image.d.cts +3 -1
- package/dist/image.d.ts +3 -1
- package/dist/image.mjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/link.cjs +1 -1
- package/dist/link.d.cts +3 -1
- package/dist/link.d.ts +3 -1
- package/dist/link.mjs +1 -1
- package/dist/scroll.mjs +1 -1
- package/dist/shared/cursor-DnDlwQ-8.mjs +1 -0
- package/dist/shared/cursor-hFfOpZfK.cjs +1 -0
- package/dist/shared/restoreCursor-DCEhO8y7.cjs +2 -0
- package/dist/shared/{restoreCursor-DcUwN1ZW.mjs → restoreCursor-DPTYk7C7.mjs} +1 -1
- package/dist/strip.cjs +1 -1
- package/dist/strip.d.cts +3 -1
- package/dist/strip.d.ts +3 -1
- package/dist/strip.mjs +1 -1
- package/package.json +22 -5
- package/dist/shared/restoreCursor-2voIAMlO.cjs +0 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,35 @@
|
|
|
1
|
+
## @visulima/ansi [1.0.5](https://github.com/visulima/visulima/compare/@visulima/ansi@1.0.4...@visulima/ansi@1.0.5) (2024-09-07)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
* fixed broken chunk splitting from packem ([1aaf277](https://github.com/visulima/visulima/commit/1aaf27779292d637923c5f8a220e18606e78caa2))
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Dependencies
|
|
9
|
+
|
|
10
|
+
* **@visulima/colorize:** upgraded to 1.4.8
|
|
11
|
+
* **@visulima/path:** upgraded to 1.0.7
|
|
12
|
+
|
|
13
|
+
## @visulima/ansi [1.0.4](https://github.com/visulima/visulima/compare/@visulima/ansi@1.0.3...@visulima/ansi@1.0.4) (2024-09-07)
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* added types support for node10 ([604583f](https://github.com/visulima/visulima/commit/604583fa3c24b950fafad45d17e7a1333040fd76))
|
|
18
|
+
|
|
19
|
+
### Styles
|
|
20
|
+
|
|
21
|
+
* cs fixes ([f5c4af7](https://github.com/visulima/visulima/commit/f5c4af7cfa9fc79b6d3fa60c1e48d88bffab5a08))
|
|
22
|
+
|
|
23
|
+
### Miscellaneous Chores
|
|
24
|
+
|
|
25
|
+
* update dev dependencies ([0738f98](https://github.com/visulima/visulima/commit/0738f9810478bb215ce4b2571dc8874c4c503089))
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Dependencies
|
|
29
|
+
|
|
30
|
+
* **@visulima/colorize:** upgraded to 1.4.7
|
|
31
|
+
* **@visulima/path:** upgraded to 1.0.6
|
|
32
|
+
|
|
1
33
|
## @visulima/ansi [1.0.3](https://github.com/visulima/visulima/compare/@visulima/ansi@1.0.2...@visulima/ansi@1.0.3) (2024-08-30)
|
|
2
34
|
|
|
3
35
|
### Bug Fixes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{E as e}from"./shared/constants-DeW8ueso.mjs";const
|
|
1
|
+
import{E as e}from"./shared/constants-DeW8ueso.mjs";const r=e+"?1049h",n=e+"?1049l";export{r as alternativeScreenEnter,n as alternativeScreenExit};
|
package/dist/clear.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./shared/constants-1ozeAQ9B.cjs"),r=require("./erase.cjs"),c=require("./cursor.cjs"),l=e.ESC+"1;1H"+e.ESC+"J",a=r.eraseLine+e.CSI+"0D",n=e.ESC+"H"+e.ESC+"2J",S=e.ESC+"2J",s=c.isWindows?r.eraseScreen+e.ESC+"0f":r.eraseScreen+e.ESC+"3J"+e.ESC+"H"+e.ESC+"c";exports.clearLine=a;exports.clearScreen=n;exports.clearScrollbar=S;exports.clearTerminal=s;exports.fullReset=l;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./shared/constants-1ozeAQ9B.cjs"),r=require("./erase.cjs"),c=require("./shared/cursor-hFfOpZfK.cjs"),l=e.ESC+"1;1H"+e.ESC+"J",a=r.eraseLine+e.CSI+"0D",n=e.ESC+"H"+e.ESC+"2J",S=e.ESC+"2J",s=c.isWindows?r.eraseScreen+e.ESC+"0f":r.eraseScreen+e.ESC+"3J"+e.ESC+"H"+e.ESC+"c";exports.clearLine=a;exports.clearScreen=n;exports.clearScrollbar=S;exports.clearTerminal=s;exports.fullReset=l;
|
package/dist/clear.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{E as
|
|
1
|
+
import{E as e,C as a}from"./shared/constants-DeW8ueso.mjs";import{eraseLine as o,eraseScreen as r}from"./erase.mjs";import{n as c}from"./shared/cursor-DnDlwQ-8.mjs";const n=e+"1;1H"+e+"J",m=o+a+"0D",t=e+"H"+e+"2J",f=e+"2J",S=c?r+e+"0f":r+e+"3J"+e+"H"+e+"c";export{m as clearLine,t as clearScreen,f as clearScrollbar,S as clearTerminal,n as fullReset};
|
package/dist/cursor.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./shared/constants-1ozeAQ9B.cjs");const r=require("./shared/cursor-hFfOpZfK.cjs"),o=require("./shared/restoreCursor-DCEhO8y7.cjs");exports.cursorBackward=r.cursorBackward;exports.cursorDown=r.cursorDown;exports.cursorForward=r.cursorForward;exports.cursorHide=r.cursorHide;exports.cursorLeft=r.cursorLeft;exports.cursorMove=r.cursorMove;exports.cursorNextLine=r.cursorNextLine;exports.cursorPreviousLine=r.cursorPreviousLine;exports.cursorRestore=r.cursorRestore;exports.cursorSave=r.cursorSave;exports.cursorShow=r.cursorShow;exports.cursorTo=r.cursorTo;exports.cursorUp=r.cursorUp;exports.restoreCursor=o;
|
package/dist/cursor.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import"./shared/constants-DeW8ueso.mjs";import{c as a,a as e,b as u,d as c,e as t,f as i,g as d,h as f,i as m,j as p,k as w,l as n,m as v}from"./shared/cursor-DnDlwQ-8.mjs";import{default as L}from"./shared/restoreCursor-DPTYk7C7.mjs";export{a as cursorBackward,e as cursorDown,u as cursorForward,c as cursorHide,t as cursorLeft,i as cursorMove,d as cursorNextLine,f as cursorPreviousLine,m as cursorRestore,p as cursorSave,w as cursorShow,n as cursorTo,v as cursorUp,L as restoreCursor};
|
package/dist/erase.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var c=Object.defineProperty;var t=(e,r)=>c(e,"name",{value:r,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./shared/constants-1ozeAQ9B.cjs"),o=require("./cursor.cjs");var S=Object.defineProperty,n=t((e,r)=>S(e,"name",{value:r,configurable:!0}),"o");const u=n((e=1)=>`${s.CSI}J`.repeat(e),"eraseDown"),i=`${s.CSI}2K`,L=`${s.CSI}K`,p=`${s.CSI}1K`,l=n(e=>{let r="";for(let a=0;a<e;a++)r+=i+(a<e-1?o.cursorUp():"");return e&&(r+=o.cursorLeft),r},"eraseLines"),C=`${s.CSI}2J`,I=n((e=1)=>`${s.CSI}1J`.repeat(e),"eraseUp");exports.eraseDown=u;exports.eraseLine=i;exports.eraseLineEnd=L;exports.eraseLineStart=p;exports.eraseLines=l;exports.eraseScreen=C;exports.eraseUp=I;
|
|
1
|
+
"use strict";var c=Object.defineProperty;var t=(e,r)=>c(e,"name",{value:r,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./shared/constants-1ozeAQ9B.cjs"),o=require("./shared/cursor-hFfOpZfK.cjs");var S=Object.defineProperty,n=t((e,r)=>S(e,"name",{value:r,configurable:!0}),"o");const u=n((e=1)=>`${s.CSI}J`.repeat(e),"eraseDown"),i=`${s.CSI}2K`,L=`${s.CSI}K`,p=`${s.CSI}1K`,l=n(e=>{let r="";for(let a=0;a<e;a++)r+=i+(a<e-1?o.cursorUp():"");return e&&(r+=o.cursorLeft),r},"eraseLines"),C=`${s.CSI}2J`,I=n((e=1)=>`${s.CSI}1J`.repeat(e),"eraseUp");exports.eraseDown=u;exports.eraseLine=i;exports.eraseLineEnd=L;exports.eraseLineStart=p;exports.eraseLines=l;exports.eraseScreen=C;exports.eraseUp=I;
|
package/dist/erase.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var o=Object.defineProperty;var t=(e,r)=>o(e,"name",{value:r,configurable:!0});import{C as a}from"./shared/constants-DeW8ueso.mjs";import{m as i,e as p}from"./cursor.mjs";var c=Object.defineProperty,n=t((e,r)=>c(e,"name",{value:r,configurable:!0}),"o");const u=n((e=1)=>`${a}J`.repeat(e),"eraseDown"),f=`${a}2K`,l=`${a}K`,
|
|
1
|
+
var o=Object.defineProperty;var t=(e,r)=>o(e,"name",{value:r,configurable:!0});import{C as a}from"./shared/constants-DeW8ueso.mjs";import{m as i,e as p}from"./shared/cursor-DnDlwQ-8.mjs";var c=Object.defineProperty,n=t((e,r)=>c(e,"name",{value:r,configurable:!0}),"o");const u=n((e=1)=>`${a}J`.repeat(e),"eraseDown"),f=`${a}2K`,l=`${a}K`,v=`${a}1K`,J=n(e=>{let r="";for(let s=0;s<e;s++)r+=f+(s<e-1?i():"");return e&&(r+=p),r},"eraseLines"),K=`${a}2J`,S=n((e=1)=>`${a}1J`.repeat(e),"eraseUp");export{u as eraseDown,f as eraseLine,l as eraseLineEnd,v as eraseLineStart,J as eraseLines,K as eraseScreen,S as eraseUp};
|
package/dist/image.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var a=Object.defineProperty;var r=(t,e)=>a(t,"name",{value:e,configurable:!0});
|
|
1
|
+
"use strict";var a=Object.defineProperty;var r=(t,e)=>a(t,"name",{value:e,configurable:!0});const s=require("./shared/constants-1ozeAQ9B.cjs");var n=Object.defineProperty,o=r((t,e)=>n(t,"name",{value:e,configurable:!0}),"i");const h=o((t,e={})=>{let i=`${s.OSC}1337;File=inline=1`;return e.width&&(i+=`;width=${e.width}`),e.height&&(i+=`;height=${e.height}`),e.preserveAspectRatio===!1&&(i+=";preserveAspectRatio=0"),i+":"+Buffer.from(t).toString("base64")+s.BEL},"image");module.exports=h;
|
package/dist/image.d.cts
CHANGED
package/dist/image.d.ts
CHANGED
package/dist/image.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var a=Object.defineProperty;var r=(t,e)=>a(t,"name",{value:e,configurable:!0});import{B as o,O as h}from"./shared/constants-DeW8ueso.mjs";var
|
|
1
|
+
var a=Object.defineProperty;var r=(t,e)=>a(t,"name",{value:e,configurable:!0});import{B as o,O as h}from"./shared/constants-DeW8ueso.mjs";var s=Object.defineProperty,n=r((t,e)=>s(t,"name",{value:e,configurable:!0}),"i");const g=n((t,e={})=>{let i=`${h}1337;File=inline=1`;return e.width&&(i+=`;width=${e.width}`),e.height&&(i+=`;height=${e.height}`),e.preserveAspectRatio===!1&&(i+=";preserveAspectRatio=0"),i+":"+Buffer.from(t).toString("base64")+o},"image");export{g as default};
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./alternative-screen.cjs"),s=require("./clear.cjs"),r=require("./shared/cursor-hFfOpZfK.cjs"),e=require("./erase.cjs"),n=require("./image.cjs"),a=require("./link.cjs"),o=require("./scroll.cjs"),i=require("./strip.cjs"),t="\x07";exports.alternativeScreenEnter=c.alternativeScreenEnter;exports.alternativeScreenExit=c.alternativeScreenExit;exports.clearLine=s.clearLine;exports.clearScreen=s.clearScreen;exports.clearScrollbar=s.clearScrollbar;exports.clearTerminal=s.clearTerminal;exports.fullReset=s.fullReset;exports.cursorBackward=r.cursorBackward;exports.cursorDown=r.cursorDown;exports.cursorForward=r.cursorForward;exports.cursorHide=r.cursorHide;exports.cursorLeft=r.cursorLeft;exports.cursorMove=r.cursorMove;exports.cursorNextLine=r.cursorNextLine;exports.cursorPreviousLine=r.cursorPreviousLine;exports.cursorRestore=r.cursorRestore;exports.cursorSave=r.cursorSave;exports.cursorShow=r.cursorShow;exports.cursorTo=r.cursorTo;exports.cursorUp=r.cursorUp;exports.eraseDown=e.eraseDown;exports.eraseLine=e.eraseLine;exports.eraseLineEnd=e.eraseLineEnd;exports.eraseLineStart=e.eraseLineStart;exports.eraseLines=e.eraseLines;exports.eraseScreen=e.eraseScreen;exports.eraseUp=e.eraseUp;exports.image=n;exports.link=a;exports.scrollDown=o.scrollDown;exports.scrollUp=o.scrollUp;exports.strip=i;exports.beep=t;
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,
|
|
1
|
+
import{alternativeScreenEnter as a,alternativeScreenExit as o}from"./alternative-screen.mjs";import{clearLine as t,clearScreen as n,clearScrollbar as l,clearTerminal as u,fullReset as i}from"./clear.mjs";import{c as p,a as x,b as m,d,e as L,f as S,g as w,h as v,i as b,j as k,k as D,l as E,m as U}from"./shared/cursor-DnDlwQ-8.mjs";import{eraseDown as h,eraseLine as R,eraseLineEnd as T,eraseLineStart as j,eraseLines as B,eraseScreen as F,eraseUp as H}from"./erase.mjs";import{default as N}from"./image.mjs";import{default as q}from"./link.mjs";import{scrollDown as z,scrollUp as A}from"./scroll.mjs";import{default as G}from"./strip.mjs";const r="\x07";export{a as alternativeScreenEnter,o as alternativeScreenExit,r as beep,t as clearLine,n as clearScreen,l as clearScrollbar,u as clearTerminal,p as cursorBackward,x as cursorDown,m as cursorForward,d as cursorHide,L as cursorLeft,S as cursorMove,w as cursorNextLine,v as cursorPreviousLine,b as cursorRestore,k as cursorSave,D as cursorShow,E as cursorTo,U as cursorUp,h as eraseDown,R as eraseLine,T as eraseLineEnd,j as eraseLineStart,B as eraseLines,F as eraseScreen,H as eraseUp,i as fullReset,N as image,q as link,z as scrollDown,A as scrollUp,G as strip};
|
package/dist/link.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var o=Object.defineProperty;var
|
|
1
|
+
"use strict";var o=Object.defineProperty;var t=(r,n)=>o(r,"name",{value:n,configurable:!0});const e=require("./shared/constants-1ozeAQ9B.cjs");var s=Object.defineProperty,a=t((r,n)=>s(r,"name",{value:n,configurable:!0}),"r");const c=a((r,n)=>[e.OSC,"8",e.SEP,e.SEP,n,e.BEL,r,e.OSC,"8",e.SEP,e.SEP,e.BEL].join(""),"link");module.exports=c;
|
package/dist/link.d.cts
CHANGED
package/dist/link.d.ts
CHANGED
package/dist/link.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var i=Object.defineProperty;var o=(a,e)=>i(a,"name",{value:e,configurable:!0});import{O as n,S as r,B as t}from"./shared/constants-DeW8ueso.mjs";var s=Object.defineProperty,f=o((a,e)=>s(a,"name",{value:e,configurable:!0}),"r");const m=f((a,e)=>[n,"8",r,r,e,t,a,n,"8",r,r,t].join(""),"link");export{m as default};
|
package/dist/scroll.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var p=Object.defineProperty;var e=(r,o)=>p(r,"name",{value:o,configurable:!0});import{C as l}from"./shared/constants-DeW8ueso.mjs";var c=Object.defineProperty,a=e((r,o)=>c(r,"name",{value:o,configurable:!0}),"o");const s=a((r=1)=>`${l}T`.repeat(r),"scrollDown"),f=a((r=1)=>`${l}S`.repeat(r),"scrollUp");export{s as scrollDown,f as scrollUp};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var p=Object.defineProperty;var u=(r,o)=>p(r,"name",{value:o,configurable:!0});import{C as s,E as c,S as t}from"./constants-DeW8ueso.mjs";import"./restoreCursor-DPTYk7C7.mjs";const i=globalThis?.window?.document!==void 0,n=!i&&process.env.TERM_PROGRAM==="Apple_Terminal",m=!i&&process.platform==="win32";var d=Object.defineProperty,e=u((r,o)=>d(r,"name",{value:o,configurable:!0}),"e");const f=e((r=1)=>s+r+"D","cursorBackward"),S=e((r=1)=>s+r+"B","cursorDown"),T=e((r=1)=>s+r+"C","cursorForward"),A=s+"?25l",C=s+"G",E=e((r,o)=>{let a="";return r<0?a+=s+-r+"D":r>0&&(a+=s+r+"C"),o<0?a+=s+-o+"A":o>0&&(a+=s+o+"B"),a},"cursorMove"),L=e((r=1)=>(s+"E").repeat(r),"cursorNextLine"),P=e((r=1)=>(s+"F").repeat(r),"cursorPreviousLine"),b=n?c+"8":c+"u",h=n?c+"7":c+"s",B=s+"?25h",D=e((r,o)=>!o&&o!==0?s+(r+1)+"G":s+(o+1)+t+(r+1)+"H","cursorTo"),M=e((r=1)=>s+r+"A","cursorUp");export{S as a,T as b,f as c,A as d,C as e,E as f,L as g,P as h,b as i,h as j,B as k,D as l,M as m,m as n};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var S=Object.defineProperty;var u=(r,s)=>S(r,"name",{value:s,configurable:!0});const o=require("./constants-1ozeAQ9B.cjs");require("./restoreCursor-DCEhO8y7.cjs");const i=globalThis?.window?.document!==void 0,n=!i&&process.env.TERM_PROGRAM==="Apple_Terminal",a=!i&&process.platform==="win32";var C=Object.defineProperty,e=u((r,s)=>C(r,"name",{value:s,configurable:!0}),"e");const t=e((r=1)=>o.CSI+r+"D","cursorBackward"),w=e((r=1)=>o.CSI+r+"B","cursorDown"),I=e((r=1)=>o.CSI+r+"C","cursorForward"),d=o.CSI+"?25l",p=o.CSI+"G",v=e((r,s)=>{let c="";return r<0?c+=o.CSI+-r+"D":r>0&&(c+=o.CSI+r+"C"),s<0?c+=o.CSI+-s+"A":s>0&&(c+=o.CSI+s+"B"),c},"cursorMove"),l=e((r=1)=>(o.CSI+"E").repeat(r),"cursorNextLine"),L=e((r=1)=>(o.CSI+"F").repeat(r),"cursorPreviousLine"),E=n?o.ESC+"8":o.ESC+"u",T=n?o.ESC+"7":o.ESC+"s",P=o.CSI+"?25h",f=e((r,s)=>!s&&s!==0?o.CSI+(r+1)+"G":o.CSI+(s+1)+o.SEP+(r+1)+"H","cursorTo"),m=e((r=1)=>o.CSI+r+"A","cursorUp");exports.cursorBackward=t;exports.cursorDown=w;exports.cursorForward=I;exports.cursorHide=d;exports.cursorLeft=p;exports.cursorMove=v;exports.cursorNextLine=l;exports.cursorPreviousLine=L;exports.cursorRestore=E;exports.cursorSave=T;exports.cursorShow=P;exports.cursorTo=f;exports.cursorUp=m;exports.isWindows=a;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var b=Object.defineProperty;var s=(t,e)=>b(t,"name",{value:e,configurable:!0});const S=require("node:process"),w=s(t=>t&&typeof t=="object"&&"default"in t?t.default:t,"_interopDefaultCompat"),c=w(S),E=s((t,e,i,n)=>{if(i==="length"||i==="prototype"||i==="arguments"||i==="caller")return;const r=Object.getOwnPropertyDescriptor(t,i),o=Object.getOwnPropertyDescriptor(e,i);!I(r,o)&&n||Object.defineProperty(t,i,o)},"copyProperty"),I=s(function(t,e){return t===void 0||t.configurable||t.writable===e.writable&&t.enumerable===e.enumerable&&t.configurable===e.configurable&&(t.writable||t.value===e.value)},"canCopyProperty"),O=s((t,e)=>{const i=Object.getPrototypeOf(e);i!==Object.getPrototypeOf(t)&&Object.setPrototypeOf(t,i)},"changePrototype"),P=s((t,e)=>`/* Wrapped ${t}*/
|
|
2
|
+
${e}`,"wrappedToString"),T=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),G=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),j=s((t,e,i)=>{const n=i===""?"":`with ${i.trim()}() `,r=P.bind(null,n,e.toString());Object.defineProperty(r,"name",G);const{writable:o,enumerable:a,configurable:h}=T;Object.defineProperty(t,"toString",{value:r,writable:o,enumerable:a,configurable:h})},"changeToString");function _(t,e,{ignoreNonConfigurable:i=!1}={}){const{name:n}=t;for(const r of Reflect.ownKeys(e))E(t,e,r,i);return O(t,e),j(t,e,n),t}s(_,"mimicFunction");const f=new WeakMap,g=s((t,e={})=>{if(typeof t!="function")throw new TypeError("Expected a function");let i,n=0;const r=t.displayName||t.name||"<anonymous>",o=s(function(...a){if(f.set(o,++n),n===1)i=t.apply(this,a),t=void 0;else if(e.throw===!0)throw new Error(`Function \`${r}\` can only be called once`);return i},"onetime");return _(o,t),f.set(o,n),o},"onetime");g.callCount=t=>{if(!f.has(t))throw new Error(`The given function \`${t.name}\` is not wrapped by the \`onetime\` package`);return f.get(t)};const l=[];l.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&l.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&l.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");const u=s(t=>!!t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function","processOk"),d=Symbol.for("signal-exit emitter"),p=globalThis,L=Object.defineProperty.bind(Object);class C{static{s(this,"Emitter")}emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(p[d])return p[d];L(p,d,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,i){this.listeners[e].push(i)}removeListener(e,i){const n=this.listeners[e],r=n.indexOf(i);r!==-1&&(r===0&&n.length===1?n.length=0:n.splice(r,1))}emit(e,i,n){if(this.emitted[e])return!1;this.emitted[e]=!0;let r=!1;for(const o of this.listeners[e])r=o(i,n)===!0||r;return e==="exit"&&(r=this.emit("afterExit",i,n)||r),r}}class x{static{s(this,"SignalExitBase")}}const R=s(t=>({onExit(e,i){return t.onExit(e,i)},load(){return t.load()},unload(){return t.unload()}}),"signalExitWrap");class F extends x{static{s(this,"SignalExitFallback")}onExit(){return()=>{}}load(){}unload(){}}class k extends x{static{s(this,"SignalExit")}#o=m.platform==="win32"?"SIGINT":"SIGHUP";#e=new C;#t;#r;#s;#n={};#i=!1;constructor(e){super(),this.#t=e,this.#n={};for(const i of l)this.#n[i]=()=>{const n=this.#t.listeners(i);let{count:r}=this.#e;const o=e;if(typeof o.__signal_exit_emitter__=="object"&&typeof o.__signal_exit_emitter__.count=="number"&&(r+=o.__signal_exit_emitter__.count),n.length===r){this.unload();const a=this.#e.emit("exit",null,i),h=i==="SIGHUP"?this.#o:i;a||e.kill(e.pid,h)}};this.#s=e.reallyExit,this.#r=e.emit}onExit(e,i){if(!u(this.#t))return()=>{};this.#i===!1&&this.load();const n=i?.alwaysLast?"afterExit":"exit";return this.#e.on(n,e),()=>{this.#e.removeListener(n,e),this.#e.listeners.exit.length===0&&this.#e.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#i){this.#i=!0,this.#e.count+=1;for(const e of l)try{const i=this.#n[e];i&&this.#t.on(e,i)}catch{}this.#t.emit=(e,...i)=>this.#a(e,...i),this.#t.reallyExit=e=>this.#l(e)}}unload(){this.#i&&(this.#i=!1,l.forEach(e=>{const i=this.#n[e];if(!i)throw new Error("Listener not defined for signal: "+e);try{this.#t.removeListener(e,i)}catch{}}),this.#t.emit=this.#r,this.#t.reallyExit=this.#s,this.#e.count-=1)}#l(e){return u(this.#t)?(this.#t.exitCode=e||0,this.#e.emit("exit",this.#t.exitCode,null),this.#s.call(this.#t,this.#t.exitCode)):0}#a(e,...i){const n=this.#r;if(e==="exit"&&u(this.#t)){typeof i[0]=="number"&&(this.#t.exitCode=i[0]);const r=n.call(this.#t,e,...i);return this.#e.emit("exit",this.#t.exitCode,null),r}else return n.call(this.#t,e,...i)}}const m=globalThis.process,{onExit:$,load:v,unload:M}=R(u(m)?new k(m):new F),y=c.stderr.isTTY?c.stderr:c.stdout.isTTY?c.stdout:void 0,N=y?g(()=>{$(()=>{y.write("\x1B[?25h")},{alwaysLast:!0})}):()=>{};module.exports=N;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
var b=Object.defineProperty;var o=(e,t)=>b(e,"name",{value:t,configurable:!0});import c from"node:process";const S=o((e,t,i,n)=>{if(i==="length"||i==="prototype"||i==="arguments"||i==="caller")return;const r=Object.getOwnPropertyDescriptor(e,i),s=Object.getOwnPropertyDescriptor(t,i);!w(r,s)&&n||Object.defineProperty(e,i,s)},"copyProperty"),w=o(function(e,t){return e===void 0||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},"canCopyProperty"),E=o((e,t)=>{const i=Object.getPrototypeOf(t);i!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,i)},"changePrototype"),I=o((e,t)=>`/* Wrapped ${e}*/
|
|
2
|
-
${t}`,"wrappedToString"),O=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),P=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),T=o((e,t,i)=>{const n=i===""?"":`with ${i.trim()}() `,r=I.bind(null,n,t.toString());Object.defineProperty(r,"name",P);const{writable:s,enumerable:a,configurable:h}=O;Object.defineProperty(e,"toString",{value:r,writable:s,enumerable:a,configurable:h})},"changeToString");function G(e,t,{ignoreNonConfigurable:i=!1}={}){const{name:n}=e;for(const r of Reflect.ownKeys(t))S(e,t,r,i);return E(e,t),T(e,t,n),e}o(G,"mimicFunction");const f=new WeakMap,y=o((e,t={})=>{if(typeof e!="function")throw new TypeError("Expected a function");let i,n=0;const r=e.displayName||e.name||"<anonymous>",s=o(function(...a){if(f.set(s,++n),n===1)i=e.apply(this,a),e=void 0;else if(t.throw===!0)throw new Error(`Function \`${r}\` can only be called once`);return i},"onetime");return G(s,e),f.set(s,n),s},"onetime");y.callCount=e=>{if(!f.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return f.get(e)};const l=[];l.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&l.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&l.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");const u=o(e=>!!e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function","processOk"),d=Symbol.for("signal-exit emitter"),m=globalThis,j=Object.defineProperty.bind(Object);class L{static{o(this,"Emitter")}emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(m[d])return m[d];j(m,d,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(t,i){this.listeners[t].push(i)}removeListener(t,i){const n=this.listeners[t],r=n.indexOf(i);r!==-1&&(r===0&&n.length===1?n.length=0:n.splice(r,1))}emit(t,i,n){if(this.emitted[t])return!1;this.emitted[t]=!0;let r=!1;for(const s of this.listeners[t])r=s(i,n)===!0||r;return t==="exit"&&(r=this.emit("afterExit",i,n)||r),r}}class x{static{o(this,"SignalExitBase")}}const _=o(e=>({onExit(t,i){return e.onExit(t,i)},load(){return e.load()},unload(){return e.unload()}}),"signalExitWrap");class
|
|
2
|
+
${t}`,"wrappedToString"),O=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),P=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),T=o((e,t,i)=>{const n=i===""?"":`with ${i.trim()}() `,r=I.bind(null,n,t.toString());Object.defineProperty(r,"name",P);const{writable:s,enumerable:a,configurable:h}=O;Object.defineProperty(e,"toString",{value:r,writable:s,enumerable:a,configurable:h})},"changeToString");function G(e,t,{ignoreNonConfigurable:i=!1}={}){const{name:n}=e;for(const r of Reflect.ownKeys(t))S(e,t,r,i);return E(e,t),T(e,t,n),e}o(G,"mimicFunction");const f=new WeakMap,y=o((e,t={})=>{if(typeof e!="function")throw new TypeError("Expected a function");let i,n=0;const r=e.displayName||e.name||"<anonymous>",s=o(function(...a){if(f.set(s,++n),n===1)i=e.apply(this,a),e=void 0;else if(t.throw===!0)throw new Error(`Function \`${r}\` can only be called once`);return i},"onetime");return G(s,e),f.set(s,n),s},"onetime");y.callCount=e=>{if(!f.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return f.get(e)};const l=[];l.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&l.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&l.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");const u=o(e=>!!e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function","processOk"),d=Symbol.for("signal-exit emitter"),m=globalThis,j=Object.defineProperty.bind(Object);class L{static{o(this,"Emitter")}emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(m[d])return m[d];j(m,d,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(t,i){this.listeners[t].push(i)}removeListener(t,i){const n=this.listeners[t],r=n.indexOf(i);r!==-1&&(r===0&&n.length===1?n.length=0:n.splice(r,1))}emit(t,i,n){if(this.emitted[t])return!1;this.emitted[t]=!0;let r=!1;for(const s of this.listeners[t])r=s(i,n)===!0||r;return t==="exit"&&(r=this.emit("afterExit",i,n)||r),r}}class x{static{o(this,"SignalExitBase")}}const _=o(e=>({onExit(t,i){return e.onExit(t,i)},load(){return e.load()},unload(){return e.unload()}}),"signalExitWrap");class C extends x{static{o(this,"SignalExitFallback")}onExit(){return()=>{}}load(){}unload(){}}class R extends x{static{o(this,"SignalExit")}#o=p.platform==="win32"?"SIGINT":"SIGHUP";#e=new L;#t;#r;#s;#n={};#i=!1;constructor(t){super(),this.#t=t,this.#n={};for(const i of l)this.#n[i]=()=>{const n=this.#t.listeners(i);let{count:r}=this.#e;const s=t;if(typeof s.__signal_exit_emitter__=="object"&&typeof s.__signal_exit_emitter__.count=="number"&&(r+=s.__signal_exit_emitter__.count),n.length===r){this.unload();const a=this.#e.emit("exit",null,i),h=i==="SIGHUP"?this.#o:i;a||t.kill(t.pid,h)}};this.#s=t.reallyExit,this.#r=t.emit}onExit(t,i){if(!u(this.#t))return()=>{};this.#i===!1&&this.load();const n=i?.alwaysLast?"afterExit":"exit";return this.#e.on(n,t),()=>{this.#e.removeListener(n,t),this.#e.listeners.exit.length===0&&this.#e.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#i){this.#i=!0,this.#e.count+=1;for(const t of l)try{const i=this.#n[t];i&&this.#t.on(t,i)}catch{}this.#t.emit=(t,...i)=>this.#a(t,...i),this.#t.reallyExit=t=>this.#l(t)}}unload(){this.#i&&(this.#i=!1,l.forEach(t=>{const i=this.#n[t];if(!i)throw new Error("Listener not defined for signal: "+t);try{this.#t.removeListener(t,i)}catch{}}),this.#t.emit=this.#r,this.#t.reallyExit=this.#s,this.#e.count-=1)}#l(t){return u(this.#t)?(this.#t.exitCode=t||0,this.#e.emit("exit",this.#t.exitCode,null),this.#s.call(this.#t,this.#t.exitCode)):0}#a(t,...i){const n=this.#r;if(t==="exit"&&u(this.#t)){typeof i[0]=="number"&&(this.#t.exitCode=i[0]);const r=n.call(this.#t,t,...i);return this.#e.emit("exit",this.#t.exitCode,null),r}else return n.call(this.#t,t,...i)}}const p=globalThis.process,{onExit:F,load:N,unload:U}=_(u(p)?new R(p):new C),g=c.stderr.isTTY?c.stderr:c.stdout.isTTY?c.stdout:void 0,v=g?y(()=>{F(()=>{g.write("\x1B[?25h")},{alwaysLast:!0})}):()=>{};export{v as default};
|
package/dist/strip.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var a=Object.defineProperty;var r=(e,n)=>a(e,"name",{value:n,configurable:!0});function t({onlyFirst:e=!1}={}){const n=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(n,e?void 0:"g")}r(t,"ansiRegex");var u=Object.defineProperty,c=r((e,n)=>u(e,"name",{value:n,configurable:!0}),"r");const d=t(),s=c(e=>e.replace(/\u001B\]0;.*\u0007/,"").replace(d,""),"strip");module.exports=s;
|
package/dist/strip.d.cts
CHANGED
package/dist/strip.d.ts
CHANGED
package/dist/strip.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var r=Object.defineProperty;var a=(e,n)=>r(e,"name",{value:n,configurable:!0});function t({onlyFirst:e=!1}={}){const n=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(n,e?void 0:"g")}a(t,"ansiRegex");var u=Object.defineProperty,d=a((e,n)=>u(e,"name",{value:n,configurable:!0}),"r");const c=t(),f=d(e=>e.replace(/\u001B\]0;.*\u0007/,"").replace(c,""),"strip");export{f as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visulima/ansi",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "ANSI escape codes for some terminal swag.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"alternative-screen",
|
|
@@ -161,6 +161,21 @@
|
|
|
161
161
|
"module": "dist/index.mjs",
|
|
162
162
|
"browser": "./dist/index.mjs",
|
|
163
163
|
"types": "dist/index.d.ts",
|
|
164
|
+
"typesVersions": {
|
|
165
|
+
"*": {
|
|
166
|
+
"*": [
|
|
167
|
+
"./dist/alternative-screen.d.ts",
|
|
168
|
+
"./dist/clear.d.ts",
|
|
169
|
+
"./dist/cursor.d.ts",
|
|
170
|
+
"./dist/erase.d.ts",
|
|
171
|
+
"./dist/image.d.ts",
|
|
172
|
+
"./dist/index.d.ts",
|
|
173
|
+
"./dist/link.d.ts",
|
|
174
|
+
"./dist/scroll.d.ts",
|
|
175
|
+
"./dist/strip.d.ts"
|
|
176
|
+
]
|
|
177
|
+
}
|
|
178
|
+
},
|
|
164
179
|
"files": [
|
|
165
180
|
"dist",
|
|
166
181
|
"README.md",
|
|
@@ -171,14 +186,15 @@
|
|
|
171
186
|
"@anolilab/prettier-config": "^5.0.14",
|
|
172
187
|
"@anolilab/semantic-release-pnpm": "1.1.3",
|
|
173
188
|
"@anolilab/semantic-release-preset": "^9.0.0",
|
|
189
|
+
"@arethetypeswrong/cli": "^0.15.4",
|
|
174
190
|
"@babel/core": "^7.25.2",
|
|
175
191
|
"@rushstack/eslint-plugin-security": "^0.8.2",
|
|
176
192
|
"@secretlint/secretlint-rule-preset-recommend": "^8.2.4",
|
|
177
|
-
"@total-typescript/ts-reset": "^0.6.
|
|
193
|
+
"@total-typescript/ts-reset": "^0.6.1",
|
|
178
194
|
"@types/node": "20.14.6",
|
|
179
|
-
"@visulima/colorize": "1.4.
|
|
180
|
-
"@visulima/packem": "^1.0.0-alpha.
|
|
181
|
-
"@visulima/path": "1.0.
|
|
195
|
+
"@visulima/colorize": "1.4.8",
|
|
196
|
+
"@visulima/packem": "^1.0.0-alpha.95",
|
|
197
|
+
"@visulima/path": "1.0.7",
|
|
182
198
|
"@vitest/coverage-v8": "^2.0.5",
|
|
183
199
|
"@vitest/ui": "^2.0.5",
|
|
184
200
|
"ansi-regex": "^6.0.1",
|
|
@@ -226,6 +242,7 @@
|
|
|
226
242
|
"build:prod": "cross-env NODE_ENV=production packem build",
|
|
227
243
|
"clean": "rimraf node_modules dist .eslintcache",
|
|
228
244
|
"dev": "pnpm run build --watch",
|
|
245
|
+
"lint:attw": "attw --pack",
|
|
229
246
|
"lint:eslint": "eslint . --ext js,cjs,mjs,jsx,ts,tsx,json,yaml,yml,md,mdx --max-warnings=0 --config .eslintrc.cjs",
|
|
230
247
|
"lint:eslint:fix": "eslint . --ext js,cjs,mjs,jsx,ts,tsx,json,yaml,yml,md,mdx --max-warnings=0 --config .eslintrc.cjs --fix",
|
|
231
248
|
"lint:package-json": "publint --strict",
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var b=Object.defineProperty;var r=(t,e)=>b(t,"name",{value:e,configurable:!0});const S=require("node:process"),w=r(t=>t&&typeof t=="object"&&"default"in t?t.default:t,"_interopDefaultCompat"),c=w(S),E=r((t,e,i,n)=>{if(i==="length"||i==="prototype"||i==="arguments"||i==="caller")return;const s=Object.getOwnPropertyDescriptor(t,i),o=Object.getOwnPropertyDescriptor(e,i);!I(s,o)&&n||Object.defineProperty(t,i,o)},"copyProperty"),I=r(function(t,e){return t===void 0||t.configurable||t.writable===e.writable&&t.enumerable===e.enumerable&&t.configurable===e.configurable&&(t.writable||t.value===e.value)},"canCopyProperty"),O=r((t,e)=>{const i=Object.getPrototypeOf(e);i!==Object.getPrototypeOf(t)&&Object.setPrototypeOf(t,i)},"changePrototype"),P=r((t,e)=>`/* Wrapped ${t}*/
|
|
2
|
-
${e}`,"wrappedToString"),T=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),G=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),j=r((t,e,i)=>{const n=i===""?"":`with ${i.trim()}() `,s=P.bind(null,n,e.toString());Object.defineProperty(s,"name",G);const{writable:o,enumerable:a,configurable:h}=T;Object.defineProperty(t,"toString",{value:s,writable:o,enumerable:a,configurable:h})},"changeToString");function _(t,e,{ignoreNonConfigurable:i=!1}={}){const{name:n}=t;for(const s of Reflect.ownKeys(e))E(t,e,s,i);return O(t,e),j(t,e,n),t}r(_,"mimicFunction");const f=new WeakMap,g=r((t,e={})=>{if(typeof t!="function")throw new TypeError("Expected a function");let i,n=0;const s=t.displayName||t.name||"<anonymous>",o=r(function(...a){if(f.set(o,++n),n===1)i=t.apply(this,a),t=void 0;else if(e.throw===!0)throw new Error(`Function \`${s}\` can only be called once`);return i},"onetime");return _(o,t),f.set(o,n),o},"onetime");g.callCount=t=>{if(!f.has(t))throw new Error(`The given function \`${t.name}\` is not wrapped by the \`onetime\` package`);return f.get(t)};const l=[];l.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&l.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&l.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");const u=r(t=>!!t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function","processOk"),d=Symbol.for("signal-exit emitter"),m=globalThis,L=Object.defineProperty.bind(Object);class C{static{r(this,"Emitter")}emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(m[d])return m[d];L(m,d,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,i){this.listeners[e].push(i)}removeListener(e,i){const n=this.listeners[e],s=n.indexOf(i);s!==-1&&(s===0&&n.length===1?n.length=0:n.splice(s,1))}emit(e,i,n){if(this.emitted[e])return!1;this.emitted[e]=!0;let s=!1;for(const o of this.listeners[e])s=o(i,n)===!0||s;return e==="exit"&&(s=this.emit("afterExit",i,n)||s),s}}class x{static{r(this,"SignalExitBase")}}const R=r(t=>({onExit(e,i){return t.onExit(e,i)},load(){return t.load()},unload(){return t.unload()}}),"signalExitWrap");class F extends x{static{r(this,"SignalExitFallback")}onExit(){return()=>{}}load(){}unload(){}}class k extends x{static{r(this,"SignalExit")}#o=p.platform==="win32"?"SIGINT":"SIGHUP";#e=new C;#t;#s;#r;#n={};#i=!1;constructor(e){super(),this.#t=e,this.#n={};for(const i of l)this.#n[i]=()=>{const n=this.#t.listeners(i);let{count:s}=this.#e;const o=e;if(typeof o.__signal_exit_emitter__=="object"&&typeof o.__signal_exit_emitter__.count=="number"&&(s+=o.__signal_exit_emitter__.count),n.length===s){this.unload();const a=this.#e.emit("exit",null,i),h=i==="SIGHUP"?this.#o:i;a||e.kill(e.pid,h)}};this.#r=e.reallyExit,this.#s=e.emit}onExit(e,i){if(!u(this.#t))return()=>{};this.#i===!1&&this.load();const n=i?.alwaysLast?"afterExit":"exit";return this.#e.on(n,e),()=>{this.#e.removeListener(n,e),this.#e.listeners.exit.length===0&&this.#e.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#i){this.#i=!0,this.#e.count+=1;for(const e of l)try{const i=this.#n[e];i&&this.#t.on(e,i)}catch{}this.#t.emit=(e,...i)=>this.#a(e,...i),this.#t.reallyExit=e=>this.#l(e)}}unload(){this.#i&&(this.#i=!1,l.forEach(e=>{const i=this.#n[e];if(!i)throw new Error("Listener not defined for signal: "+e);try{this.#t.removeListener(e,i)}catch{}}),this.#t.emit=this.#s,this.#t.reallyExit=this.#r,this.#e.count-=1)}#l(e){return u(this.#t)?(this.#t.exitCode=e||0,this.#e.emit("exit",this.#t.exitCode,null),this.#r.call(this.#t,this.#t.exitCode)):0}#a(e,...i){const n=this.#s;if(e==="exit"&&u(this.#t)){typeof i[0]=="number"&&(this.#t.exitCode=i[0]);const s=n.call(this.#t,e,...i);return this.#e.emit("exit",this.#t.exitCode,null),s}else return n.call(this.#t,e,...i)}}const p=globalThis.process,{onExit:$,load:U,unload:v}=R(u(p)?new k(p):new F),y=c.stderr.isTTY?c.stderr:c.stdout.isTTY?c.stdout:void 0;y&&g(()=>{$(()=>{y.write("\x1B[?25h")},{alwaysLast:!0})});
|