@visulima/ansi 1.0.0 → 1.0.1
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 +20 -0
- package/LICENSE.md +2 -2
- 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/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/shared/ansi.CMSoxjsy.cjs +2 -0
- package/dist/shared/ansi.Cq7tP_xU.mjs +2 -0
- package/package.json +16 -16
- package/dist/shared/ansi.9Kd0EabY.cjs +0 -2
- package/dist/shared/ansi.DYO3ognR.mjs +0 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
## @visulima/ansi [1.0.1](https://github.com/visulima/visulima/compare/@visulima/ansi@1.0.0...@visulima/ansi@1.0.1) (2024-08-01)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
* upgraded @visulima/packem ([dc0cb57](https://github.com/visulima/visulima/commit/dc0cb5701b30f3f81404346c909fd4daf891b894))
|
|
6
|
+
|
|
7
|
+
### Miscellaneous Chores
|
|
8
|
+
|
|
9
|
+
* added private true into fixture package.json files ([4a9494c](https://github.com/visulima/visulima/commit/4a9494c642fa98f224505a1d231b5af4e73d6c79))
|
|
10
|
+
* changed typescript version back to 5.4.5 ([55d28bb](https://github.com/visulima/visulima/commit/55d28bbdc103718d19f844034b38a0e8e5af798a))
|
|
11
|
+
* updated dev dependencies ([ac67ec1](https://github.com/visulima/visulima/commit/ac67ec1bcba16175d225958e318199f60b10d179))
|
|
12
|
+
* updated dev dependencies ([34df456](https://github.com/visulima/visulima/commit/34df4569f2fc074823a406c44a131c8fbae2b147))
|
|
13
|
+
* updated dev dependencies and sorted the package.json ([9571572](https://github.com/visulima/visulima/commit/95715725a8ed053ca24fd1405a55205c79342ecb))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Dependencies
|
|
17
|
+
|
|
18
|
+
* **@visulima/colorize:** upgraded to 1.4.4
|
|
19
|
+
* **@visulima/path:** upgraded to 1.0.3
|
|
20
|
+
|
|
1
21
|
## @visulima/ansi 1.0.0 (2024-06-24)
|
|
2
22
|
|
|
3
23
|
### Features
|
package/LICENSE.md
CHANGED
|
@@ -44,10 +44,10 @@ Repository: chalk/ansi-regex
|
|
|
44
44
|
|
|
45
45
|
---------------------------------------
|
|
46
46
|
|
|
47
|
-
## mimic-
|
|
47
|
+
## mimic-function
|
|
48
48
|
License: MIT
|
|
49
49
|
By: Sindre Sorhus
|
|
50
|
-
Repository: sindresorhus/mimic-
|
|
50
|
+
Repository: sindresorhus/mimic-function
|
|
51
51
|
|
|
52
52
|
> MIT License
|
|
53
53
|
>
|
package/dist/clear.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./shared/ansi.1ozeAQ9B.cjs"),r=require("./erase.cjs"),c=require("./shared/ansi.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./shared/ansi.1ozeAQ9B.cjs"),r=require("./erase.cjs"),c=require("./shared/ansi.CMSoxjsy.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 e,C as a}from"./shared/ansi.DeW8ueso.mjs";import{eraseLine as o,eraseScreen as r}from"./erase.mjs";import{n as c}from"./shared/ansi.
|
|
1
|
+
import{E as e,C as a}from"./shared/ansi.DeW8ueso.mjs";import{eraseLine as o,eraseScreen as r}from"./erase.mjs";import{n as c}from"./shared/ansi.Cq7tP_xU.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";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./shared/ansi.1ozeAQ9B.cjs");const r=require("./shared/ansi.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./shared/ansi.1ozeAQ9B.cjs");const r=require("./shared/ansi.CMSoxjsy.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=r.restoreCursor;
|
package/dist/cursor.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared/ansi.DeW8ueso.mjs";import{c as a,a as c,b as u,d as e,e as i,f as t,g as d,h as w,i as f,j as m,k as n,l as p,m as v,r as L}from"./shared/ansi.
|
|
1
|
+
import"./shared/ansi.DeW8ueso.mjs";import{c as a,a as c,b as u,d as e,e as i,f as t,g as d,h as w,i as f,j as m,k as n,l as p,m as v,r as L}from"./shared/ansi.Cq7tP_xU.mjs";export{a as cursorBackward,c as cursorDown,u as cursorForward,e as cursorHide,i as cursorLeft,t as cursorMove,d as cursorNextLine,w as cursorPreviousLine,f as cursorRestore,m as cursorSave,n as cursorShow,p 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/ansi.1ozeAQ9B.cjs"),o=require("./shared/ansi.
|
|
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/ansi.1ozeAQ9B.cjs"),o=require("./shared/ansi.CMSoxjsy.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/ansi.DeW8ueso.mjs";import{m as i,e as p}from"./shared/ansi.
|
|
1
|
+
var o=Object.defineProperty;var t=(e,r)=>o(e,"name",{value:r,configurable:!0});import{C as a}from"./shared/ansi.DeW8ueso.mjs";import{m as i,e as p}from"./shared/ansi.Cq7tP_xU.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/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./alternative-screen.cjs"),s=require("./clear.cjs"),r=require("./shared/ansi.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./alternative-screen.cjs"),s=require("./clear.cjs"),r=require("./shared/ansi.CMSoxjsy.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{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/ansi.
|
|
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/ansi.Cq7tP_xU.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};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var E=Object.defineProperty;var s=(t,e)=>E(t,"name",{value:e,configurable:!0});const o=require("./ansi.1ozeAQ9B.cjs"),C=require("node:process"),P=s(t=>t&&typeof t=="object"&&"default"in t?t.default:t,"_interopDefaultCompat"),f=P(C),y=globalThis?.window?.document!==void 0,x=!y&&process.env.TERM_PROGRAM==="Apple_Terminal",T=!y&&process.platform==="win32",O=s((t,e,r,i)=>{if(r==="length"||r==="prototype"||r==="arguments"||r==="caller")return;const n=Object.getOwnPropertyDescriptor(t,r),c=Object.getOwnPropertyDescriptor(e,r);!G(n,c)&&i||Object.defineProperty(t,r,c)},"copyProperty"),G=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"),L=s((t,e)=>{const r=Object.getPrototypeOf(e);r!==Object.getPrototypeOf(t)&&Object.setPrototypeOf(t,r)},"changePrototype"),v=s((t,e)=>`/* Wrapped ${t}*/
|
|
2
|
+
${e}`,"wrappedToString"),_=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),j=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),R=s((t,e,r)=>{const i=r===""?"":`with ${r.trim()}() `,n=v.bind(null,i,e.toString());Object.defineProperty(n,"name",j);const{writable:c,enumerable:a,configurable:p}=_;Object.defineProperty(t,"toString",{value:n,writable:c,enumerable:a,configurable:p})},"changeToString");function F(t,e,{ignoreNonConfigurable:r=!1}={}){const{name:i}=t;for(const n of Reflect.ownKeys(e))O(t,e,n,r);return L(t,e),R(t,e,i),t}s(F,"mimicFunction");const d=new WeakMap,b=s((t,e={})=>{if(typeof t!="function")throw new TypeError("Expected a function");let r,i=0;const n=t.displayName||t.name||"<anonymous>",c=s(function(...a){if(d.set(c,++i),i===1)r=t.apply(this,a),t=void 0;else if(e.throw===!0)throw new Error(`Function \`${n}\` can only be called once`);return r},"onetime");return F(c,t),d.set(c,i),c},"onetime");b.callCount=t=>{if(!d.has(t))throw new Error(`The given function \`${t.name}\` is not wrapped by the \`onetime\` package`);return d.get(t)};const u=[];u.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&u.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&u.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");const h=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"),S=Symbol.for("signal-exit emitter"),m=globalThis,k=Object.defineProperty.bind(Object);class M{static{s(this,"Emitter")}emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(m[S])return m[S];k(m,S,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,r){this.listeners[e].push(r)}removeListener(e,r){const i=this.listeners[e],n=i.indexOf(r);n!==-1&&(n===0&&i.length===1?i.length=0:i.splice(n,1))}emit(e,r,i){if(this.emitted[e])return!1;this.emitted[e]=!0;let n=!1;for(const c of this.listeners[e])n=c(r,i)===!0||n;return e==="exit"&&(n=this.emit("afterExit",r,i)||n),n}}class I{static{s(this,"SignalExitBase")}}const A=s(t=>({onExit(e,r){return t.onExit(e,r)},load(){return t.load()},unload(){return t.unload()}}),"signalExitWrap");class N extends I{static{s(this,"SignalExitFallback")}onExit(){return()=>{}}load(){}unload(){}}class U extends I{static{s(this,"SignalExit")}#s=w.platform==="win32"?"SIGINT":"SIGHUP";#e=new M;#t;#n;#o;#i={};#r=!1;constructor(e){super(),this.#t=e,this.#i={};for(const r of u)this.#i[r]=()=>{const i=this.#t.listeners(r);let{count:n}=this.#e;const c=e;if(typeof c.__signal_exit_emitter__=="object"&&typeof c.__signal_exit_emitter__.count=="number"&&(n+=c.__signal_exit_emitter__.count),i.length===n){this.unload();const a=this.#e.emit("exit",null,r),p=r==="SIGHUP"?this.#s:r;a||e.kill(e.pid,p)}};this.#o=e.reallyExit,this.#n=e.emit}onExit(e,r){if(!h(this.#t))return()=>{};this.#r===!1&&this.load();const i=r?.alwaysLast?"afterExit":"exit";return this.#e.on(i,e),()=>{this.#e.removeListener(i,e),this.#e.listeners.exit.length===0&&this.#e.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#r){this.#r=!0,this.#e.count+=1;for(const e of u)try{const r=this.#i[e];r&&this.#t.on(e,r)}catch{}this.#t.emit=(e,...r)=>this.#l(e,...r),this.#t.reallyExit=e=>this.#c(e)}}unload(){this.#r&&(this.#r=!1,u.forEach(e=>{const r=this.#i[e];if(!r)throw new Error("Listener not defined for signal: "+e);try{this.#t.removeListener(e,r)}catch{}}),this.#t.emit=this.#n,this.#t.reallyExit=this.#o,this.#e.count-=1)}#c(e){return h(this.#t)?(this.#t.exitCode=e||0,this.#e.emit("exit",this.#t.exitCode,null),this.#o.call(this.#t,this.#t.exitCode)):0}#l(e,...r){const i=this.#n;if(e==="exit"&&h(this.#t)){typeof r[0]=="number"&&(this.#t.exitCode=r[0]);const n=i.call(this.#t,e,...r);return this.#e.emit("exit",this.#t.exitCode,null),n}else return i.call(this.#t,e,...r)}}const w=globalThis.process,{onExit:B,load:nt,unload:ot}=A(h(w)?new U(w):new N),g=f.stderr.isTTY?f.stderr:f.stdout.isTTY?f.stdout:void 0,$=g?b(()=>{B(()=>{g.write("\x1B[?25h")},{alwaysLast:!0})}):()=>{},H=$;var W=Object.defineProperty,l=s((t,e)=>W(t,"name",{value:e,configurable:!0}),"e");const D=l((t=1)=>o.CSI+t+"D","cursorBackward"),Y=l((t=1)=>o.CSI+t+"B","cursorDown"),q=l((t=1)=>o.CSI+t+"C","cursorForward"),K=o.CSI+"?25l",V=o.CSI+"G",X=l((t,e)=>{let r="";return t<0?r+=o.CSI+-t+"D":t>0&&(r+=o.CSI+t+"C"),e<0?r+=o.CSI+-e+"A":e>0&&(r+=o.CSI+e+"B"),r},"cursorMove"),Q=l((t=1)=>(o.CSI+"E").repeat(t),"cursorNextLine"),Z=l((t=1)=>(o.CSI+"F").repeat(t),"cursorPreviousLine"),z=x?o.ESC+"8":o.ESC+"u",J=x?o.ESC+"7":o.ESC+"s",tt=o.CSI+"?25h",et=l((t,e)=>!e&&e!==0?o.CSI+(t+1)+"G":o.CSI+(e+1)+o.SEP+(t+1)+"H","cursorTo"),rt=l((t=1)=>o.CSI+t+"A","cursorUp");exports.cursorBackward=D;exports.cursorDown=Y;exports.cursorForward=q;exports.cursorHide=K;exports.cursorLeft=V;exports.cursorMove=X;exports.cursorNextLine=Q;exports.cursorPreviousLine=Z;exports.cursorRestore=z;exports.cursorSave=J;exports.cursorShow=tt;exports.cursorTo=et;exports.cursorUp=rt;exports.isWindows=T;exports.restoreCursor=H;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var O=Object.defineProperty;var s=(t,e)=>O(t,"name",{value:e,configurable:!0});import{C as a,E as d,S as T}from"./ansi.DeW8ueso.mjs";import f from"node:process";const b=globalThis?.window?.document!==void 0,w=!b&&process.env.TERM_PROGRAM==="Apple_Terminal",Y=!b&&process.platform==="win32",I=s((t,e,i,r)=>{if(i==="length"||i==="prototype"||i==="arguments"||i==="caller")return;const n=Object.getOwnPropertyDescriptor(t,i),o=Object.getOwnPropertyDescriptor(e,i);!G(n,o)&&r||Object.defineProperty(t,i,o)},"copyProperty"),G=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"),L=s((t,e)=>{const i=Object.getPrototypeOf(e);i!==Object.getPrototypeOf(t)&&Object.setPrototypeOf(t,i)},"changePrototype"),j=s((t,e)=>`/* Wrapped ${t}*/
|
|
2
|
+
${e}`,"wrappedToString"),C=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),v=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),_=s((t,e,i)=>{const r=i===""?"":`with ${i.trim()}() `,n=j.bind(null,r,e.toString());Object.defineProperty(n,"name",v);const{writable:o,enumerable:u,configurable:m}=C;Object.defineProperty(t,"toString",{value:n,writable:o,enumerable:u,configurable:m})},"changeToString");function R(t,e,{ignoreNonConfigurable:i=!1}={}){const{name:r}=t;for(const n of Reflect.ownKeys(e))I(t,e,n,i);return L(t,e),_(t,e,r),t}s(R,"mimicFunction");const p=new WeakMap,E=s((t,e={})=>{if(typeof t!="function")throw new TypeError("Expected a function");let i,r=0;const n=t.displayName||t.name||"<anonymous>",o=s(function(...u){if(p.set(o,++r),r===1)i=t.apply(this,u),t=void 0;else if(e.throw===!0)throw new Error(`Function \`${n}\` can only be called once`);return i},"onetime");return R(o,t),p.set(o,r),o},"onetime");E.callCount=t=>{if(!p.has(t))throw new Error(`The given function \`${t.name}\` is not wrapped by the \`onetime\` package`);return p.get(t)};const c=[];c.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&c.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&c.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");const h=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"),g=Symbol.for("signal-exit emitter"),x=globalThis,F=Object.defineProperty.bind(Object);class k{static{s(this,"Emitter")}emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(x[g])return x[g];F(x,g,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,i){this.listeners[e].push(i)}removeListener(e,i){const r=this.listeners[e],n=r.indexOf(i);n!==-1&&(n===0&&r.length===1?r.length=0:r.splice(n,1))}emit(e,i,r){if(this.emitted[e])return!1;this.emitted[e]=!0;let n=!1;for(const o of this.listeners[e])n=o(i,r)===!0||n;return e==="exit"&&(n=this.emit("afterExit",i,r)||n),n}}class P{static{s(this,"SignalExitBase")}}const A=s(t=>({onExit(e,i){return t.onExit(e,i)},load(){return t.load()},unload(){return t.unload()}}),"signalExitWrap");class M extends P{static{s(this,"SignalExitFallback")}onExit(){return()=>{}}load(){}unload(){}}class N extends P{static{s(this,"SignalExit")}#o=y.platform==="win32"?"SIGINT":"SIGHUP";#e=new k;#t;#n;#s;#r={};#i=!1;constructor(e){super(),this.#t=e,this.#r={};for(const i of c)this.#r[i]=()=>{const r=this.#t.listeners(i);let{count:n}=this.#e;const o=e;if(typeof o.__signal_exit_emitter__=="object"&&typeof o.__signal_exit_emitter__.count=="number"&&(n+=o.__signal_exit_emitter__.count),r.length===n){this.unload();const u=this.#e.emit("exit",null,i),m=i==="SIGHUP"?this.#o:i;u||e.kill(e.pid,m)}};this.#s=e.reallyExit,this.#n=e.emit}onExit(e,i){if(!h(this.#t))return()=>{};this.#i===!1&&this.load();const r=i?.alwaysLast?"afterExit":"exit";return this.#e.on(r,e),()=>{this.#e.removeListener(r,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 c)try{const i=this.#r[e];i&&this.#t.on(e,i)}catch{}this.#t.emit=(e,...i)=>this.#l(e,...i),this.#t.reallyExit=e=>this.#a(e)}}unload(){this.#i&&(this.#i=!1,c.forEach(e=>{const i=this.#r[e];if(!i)throw new Error("Listener not defined for signal: "+e);try{this.#t.removeListener(e,i)}catch{}}),this.#t.emit=this.#n,this.#t.reallyExit=this.#s,this.#e.count-=1)}#a(e){return h(this.#t)?(this.#t.exitCode=e||0,this.#e.emit("exit",this.#t.exitCode,null),this.#s.call(this.#t,this.#t.exitCode)):0}#l(e,...i){const r=this.#n;if(e==="exit"&&h(this.#t)){typeof i[0]=="number"&&(this.#t.exitCode=i[0]);const n=r.call(this.#t,e,...i);return this.#e.emit("exit",this.#t.exitCode,null),n}else return r.call(this.#t,e,...i)}}const y=globalThis.process,{onExit:U,load:K,unload:V}=A(h(y)?new N(y):new M),S=f.stderr.isTTY?f.stderr:f.stdout.isTTY?f.stdout:void 0,$=S?E(()=>{U(()=>{S.write("\x1B[?25h")},{alwaysLast:!0})}):()=>{},X=$;var B=Object.defineProperty,l=s((t,e)=>B(t,"name",{value:e,configurable:!0}),"e");const Q=l((t=1)=>a+t+"D","cursorBackward"),Z=l((t=1)=>a+t+"B","cursorDown"),q=l((t=1)=>a+t+"C","cursorForward"),z=a+"?25l",J=a+"G",tt=l((t,e)=>{let i="";return t<0?i+=a+-t+"D":t>0&&(i+=a+t+"C"),e<0?i+=a+-e+"A":e>0&&(i+=a+e+"B"),i},"cursorMove"),et=l((t=1)=>(a+"E").repeat(t),"cursorNextLine"),it=l((t=1)=>(a+"F").repeat(t),"cursorPreviousLine"),rt=w?d+"8":d+"u",nt=w?d+"7":d+"s",st=a+"?25h",ot=l((t,e)=>!e&&e!==0?a+(t+1)+"G":a+(e+1)+T+(t+1)+"H","cursorTo"),at=l((t=1)=>a+t+"A","cursorUp");export{Z as a,q as b,Q as c,z as d,J as e,tt as f,et as g,it as h,rt as i,nt as j,st as k,ot as l,at as m,Y as n,X as r};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visulima/ansi",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "ANSI escape codes for some terminal swag.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"alternative-screen",
|
|
@@ -167,39 +167,39 @@
|
|
|
167
167
|
"CHANGELOG.md"
|
|
168
168
|
],
|
|
169
169
|
"devDependencies": {
|
|
170
|
-
"restore-cursor": "^5.0.0",
|
|
171
170
|
"@anolilab/eslint-config": "^15.0.3",
|
|
172
171
|
"@anolilab/prettier-config": "^5.0.14",
|
|
173
172
|
"@anolilab/semantic-release-pnpm": "1.1.3",
|
|
174
173
|
"@anolilab/semantic-release-preset": "^9.0.0",
|
|
175
|
-
"@babel/core": "^7.
|
|
176
|
-
"@rushstack/eslint-plugin-security": "^0.8.
|
|
174
|
+
"@babel/core": "^7.25.2",
|
|
175
|
+
"@rushstack/eslint-plugin-security": "^0.8.2",
|
|
177
176
|
"@secretlint/secretlint-rule-preset-recommend": "^8.2.4",
|
|
178
177
|
"@total-typescript/ts-reset": "^0.5.1",
|
|
179
178
|
"@types/node": "20.14.6",
|
|
180
|
-
"@visulima/colorize": "1.4.
|
|
181
|
-
"@visulima/packem": "^1.0.0-alpha.
|
|
182
|
-
"@
|
|
183
|
-
"@vitest/
|
|
179
|
+
"@visulima/colorize": "1.4.4",
|
|
180
|
+
"@visulima/packem": "^1.0.0-alpha.60",
|
|
181
|
+
"@visulima/path": "1.0.3",
|
|
182
|
+
"@vitest/coverage-v8": "^2.0.5",
|
|
183
|
+
"@vitest/ui": "^2.0.5",
|
|
184
184
|
"ansi-regex": "^6.0.1",
|
|
185
185
|
"conventional-changelog-conventionalcommits": "8.0.0",
|
|
186
186
|
"cross-env": "^7.0.3",
|
|
187
|
-
"
|
|
188
|
-
"
|
|
189
|
-
"eslint": "^8.57.0",
|
|
187
|
+
"esbuild": "0.23.0",
|
|
188
|
+
"eslint": "8.57.0",
|
|
190
189
|
"eslint-plugin-deprecation": "^3.0.0",
|
|
191
190
|
"eslint-plugin-etc": "^2.0.3",
|
|
192
191
|
"eslint-plugin-import": "npm:eslint-plugin-i@^2.29.1",
|
|
193
192
|
"eslint-plugin-mdx": "^3.1.5",
|
|
194
193
|
"eslint-plugin-vitest": "^0.4.1",
|
|
195
194
|
"eslint-plugin-vitest-globals": "^1.5.0",
|
|
196
|
-
"prettier": "^3.3.
|
|
197
|
-
"
|
|
195
|
+
"prettier": "^3.3.3",
|
|
196
|
+
"restore-cursor": "^5.1.0",
|
|
197
|
+
"rimraf": "5.0.9",
|
|
198
198
|
"secretlint": "8.2.4",
|
|
199
199
|
"semantic-release": "^24.0.0",
|
|
200
|
-
"type-fest": "^4.
|
|
201
|
-
"typescript": "
|
|
202
|
-
"vitest": "^
|
|
200
|
+
"type-fest": "^4.23.0",
|
|
201
|
+
"typescript": "5.4.5",
|
|
202
|
+
"vitest": "^2.0.5"
|
|
203
203
|
},
|
|
204
204
|
"engines": {
|
|
205
205
|
"node": ">=18.* <=22.*"
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var E=Object.defineProperty;var s=(t,e)=>E(t,"name",{value:e,configurable:!0});const o=require("./ansi.1ozeAQ9B.cjs"),C=require("node:process"),P=s(t=>t&&typeof t=="object"&&"default"in t?t.default:t,"_interopDefaultCompat"),a=P(C),y=globalThis?.window?.document!==void 0,g=!y&&process.env.TERM_PROGRAM==="Apple_Terminal",T=!y&&process.platform==="win32",O=s((t,e,r,i)=>{if(r==="length"||r==="prototype"||r==="arguments"||r==="caller")return;const n=Object.getOwnPropertyDescriptor(t,r),c=Object.getOwnPropertyDescriptor(e,r);!G(n,c)&&i||Object.defineProperty(t,r,c)},"copyProperty"),G=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"),L=s((t,e)=>{const r=Object.getPrototypeOf(e);r!==Object.getPrototypeOf(t)&&Object.setPrototypeOf(t,r)},"changePrototype"),v=s((t,e)=>`/* Wrapped ${t}*/
|
|
2
|
-
${e}`,"wrappedToString"),_=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),j=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),R=s((t,e,r)=>{const i=r===""?"":`with ${r.trim()}() `,n=v.bind(null,i,e.toString());Object.defineProperty(n,"name",j),Object.defineProperty(t,"toString",{..._,value:n})},"changeToString");function F(t,e,{ignoreNonConfigurable:r=!1}={}){const{name:i}=t;for(const n of Reflect.ownKeys(e))O(t,e,n,r);return L(t,e),R(t,e,i),t}s(F,"mimicFunction");const h=new WeakMap,x=s((t,e={})=>{if(typeof t!="function")throw new TypeError("Expected a function");let r,i=0;const n=t.displayName||t.name||"<anonymous>",c=s(function(...d){if(h.set(c,++i),i===1)r=t.apply(this,d),t=null;else if(e.throw===!0)throw new Error(`Function \`${n}\` can only be called once`);return r},"onetime");return F(c,t),h.set(c,i),c},"onetime");x.callCount=t=>{if(!h.has(t))throw new Error(`The given function \`${t.name}\` is not wrapped by the \`onetime\` package`);return h.get(t)};const u=[];u.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&u.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&u.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");const f=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"),p=Symbol.for("signal-exit emitter"),S=globalThis,k=Object.defineProperty.bind(Object);class M{static{s(this,"Emitter")}emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(S[p])return S[p];k(S,p,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,r){this.listeners[e].push(r)}removeListener(e,r){const i=this.listeners[e],n=i.indexOf(r);n!==-1&&(n===0&&i.length===1?i.length=0:i.splice(n,1))}emit(e,r,i){if(this.emitted[e])return!1;this.emitted[e]=!0;let n=!1;for(const c of this.listeners[e])n=c(r,i)===!0||n;return e==="exit"&&(n=this.emit("afterExit",r,i)||n),n}}class b{static{s(this,"SignalExitBase")}}const A=s(t=>({onExit(e,r){return t.onExit(e,r)},load(){return t.load()},unload(){return t.unload()}}),"signalExitWrap");class N extends b{static{s(this,"SignalExitFallback")}onExit(){return()=>{}}load(){}unload(){}}class U extends b{static{s(this,"SignalExit")}#s=m.platform==="win32"?"SIGINT":"SIGHUP";#e=new M;#t;#n;#o;#i={};#r=!1;constructor(e){super(),this.#t=e,this.#i={};for(const r of u)this.#i[r]=()=>{const i=this.#t.listeners(r);let{count:n}=this.#e;const c=e;if(typeof c.__signal_exit_emitter__=="object"&&typeof c.__signal_exit_emitter__.count=="number"&&(n+=c.__signal_exit_emitter__.count),i.length===n){this.unload();const d=this.#e.emit("exit",null,r),I=r==="SIGHUP"?this.#s:r;d||e.kill(e.pid,I)}};this.#o=e.reallyExit,this.#n=e.emit}onExit(e,r){if(!f(this.#t))return()=>{};this.#r===!1&&this.load();const i=r?.alwaysLast?"afterExit":"exit";return this.#e.on(i,e),()=>{this.#e.removeListener(i,e),this.#e.listeners.exit.length===0&&this.#e.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#r){this.#r=!0,this.#e.count+=1;for(const e of u)try{const r=this.#i[e];r&&this.#t.on(e,r)}catch{}this.#t.emit=(e,...r)=>this.#l(e,...r),this.#t.reallyExit=e=>this.#c(e)}}unload(){this.#r&&(this.#r=!1,u.forEach(e=>{const r=this.#i[e];if(!r)throw new Error("Listener not defined for signal: "+e);try{this.#t.removeListener(e,r)}catch{}}),this.#t.emit=this.#n,this.#t.reallyExit=this.#o,this.#e.count-=1)}#c(e){return f(this.#t)?(this.#t.exitCode=e||0,this.#e.emit("exit",this.#t.exitCode,null),this.#o.call(this.#t,this.#t.exitCode)):0}#l(e,...r){const i=this.#n;if(e==="exit"&&f(this.#t)){typeof r[0]=="number"&&(this.#t.exitCode=r[0]);const n=i.call(this.#t,e,...r);return this.#e.emit("exit",this.#t.exitCode,null),n}else return i.call(this.#t,e,...r)}}const m=globalThis.process,{onExit:B,load:it,unload:nt}=A(f(m)?new U(m):new N),w=a.stderr.isTTY?a.stderr:a.stdout.isTTY?a.stdout:void 0,$=w?x(()=>{B(()=>{w.write("\x1B[?25h")},{alwaysLast:!0})}):()=>{};var H=Object.defineProperty,l=s((t,e)=>H(t,"name",{value:e,configurable:!0}),"e");const W=l((t=1)=>o.CSI+t+"D","cursorBackward"),D=l((t=1)=>o.CSI+t+"B","cursorDown"),Y=l((t=1)=>o.CSI+t+"C","cursorForward"),q=o.CSI+"?25l",K=o.CSI+"G",V=l((t,e)=>{let r="";return t<0?r+=o.CSI+-t+"D":t>0&&(r+=o.CSI+t+"C"),e<0?r+=o.CSI+-e+"A":e>0&&(r+=o.CSI+e+"B"),r},"cursorMove"),X=l((t=1)=>(o.CSI+"E").repeat(t),"cursorNextLine"),Q=l((t=1)=>(o.CSI+"F").repeat(t),"cursorPreviousLine"),Z=g?o.ESC+"8":o.ESC+"u",z=g?o.ESC+"7":o.ESC+"s",J=o.CSI+"?25h",tt=l((t,e)=>!e&&e!==0?o.CSI+(t+1)+"G":o.CSI+(e+1)+o.SEP+(t+1)+"H","cursorTo"),et=l((t=1)=>o.CSI+t+"A","cursorUp");exports.cursorBackward=W;exports.cursorDown=D;exports.cursorForward=Y;exports.cursorHide=q;exports.cursorLeft=K;exports.cursorMove=V;exports.cursorNextLine=X;exports.cursorPreviousLine=Q;exports.cursorRestore=Z;exports.cursorSave=z;exports.cursorShow=J;exports.cursorTo=tt;exports.cursorUp=et;exports.isWindows=T;exports.restoreCursor=$;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var O=Object.defineProperty;var s=(t,e)=>O(t,"name",{value:e,configurable:!0});import{C as o,E as h,S as T}from"./ansi.DeW8ueso.mjs";import u from"node:process";const S=globalThis?.window?.document!==void 0,w=!S&&process.env.TERM_PROGRAM==="Apple_Terminal",D=!S&&process.platform==="win32",I=s((t,e,i,n)=>{if(i==="length"||i==="prototype"||i==="arguments"||i==="caller")return;const r=Object.getOwnPropertyDescriptor(t,i),a=Object.getOwnPropertyDescriptor(e,i);!G(r,a)&&n||Object.defineProperty(t,i,a)},"copyProperty"),G=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"),L=s((t,e)=>{const i=Object.getPrototypeOf(e);i!==Object.getPrototypeOf(t)&&Object.setPrototypeOf(t,i)},"changePrototype"),j=s((t,e)=>`/* Wrapped ${t}*/
|
|
2
|
-
${e}`,"wrappedToString"),v=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),C=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),_=s((t,e,i)=>{const n=i===""?"":`with ${i.trim()}() `,r=j.bind(null,n,e.toString());Object.defineProperty(r,"name",C),Object.defineProperty(t,"toString",{...v,value:r})},"changeToString");function R(t,e,{ignoreNonConfigurable:i=!1}={}){const{name:n}=t;for(const r of Reflect.ownKeys(e))I(t,e,r,i);return L(t,e),_(t,e,n),t}s(R,"mimicFunction");const p=new WeakMap,b=s((t,e={})=>{if(typeof t!="function")throw new TypeError("Expected a function");let i,n=0;const r=t.displayName||t.name||"<anonymous>",a=s(function(...d){if(p.set(a,++n),n===1)i=t.apply(this,d),t=null;else if(e.throw===!0)throw new Error(`Function \`${r}\` can only be called once`);return i},"onetime");return R(a,t),p.set(a,n),a},"onetime");b.callCount=t=>{if(!p.has(t))throw new Error(`The given function \`${t.name}\` is not wrapped by the \`onetime\` package`);return p.get(t)};const c=[];c.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&c.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&c.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");const f=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"),m=Symbol.for("signal-exit emitter"),g=globalThis,F=Object.defineProperty.bind(Object);class k{static{s(this,"Emitter")}emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(g[m])return g[m];F(g,m,{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 a of this.listeners[e])r=a(i,n)===!0||r;return e==="exit"&&(r=this.emit("afterExit",i,n)||r),r}}class E{static{s(this,"SignalExitBase")}}const A=s(t=>({onExit(e,i){return t.onExit(e,i)},load(){return t.load()},unload(){return t.unload()}}),"signalExitWrap");class M extends E{static{s(this,"SignalExitFallback")}onExit(){return()=>{}}load(){}unload(){}}class N extends E{static{s(this,"SignalExit")}#o=x.platform==="win32"?"SIGINT":"SIGHUP";#e=new k;#t;#r;#s;#n={};#i=!1;constructor(e){super(),this.#t=e,this.#n={};for(const i of c)this.#n[i]=()=>{const n=this.#t.listeners(i);let{count:r}=this.#e;const a=e;if(typeof a.__signal_exit_emitter__=="object"&&typeof a.__signal_exit_emitter__.count=="number"&&(r+=a.__signal_exit_emitter__.count),n.length===r){this.unload();const d=this.#e.emit("exit",null,i),P=i==="SIGHUP"?this.#o:i;d||e.kill(e.pid,P)}};this.#s=e.reallyExit,this.#r=e.emit}onExit(e,i){if(!f(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 c)try{const i=this.#n[e];i&&this.#t.on(e,i)}catch{}this.#t.emit=(e,...i)=>this.#l(e,...i),this.#t.reallyExit=e=>this.#a(e)}}unload(){this.#i&&(this.#i=!1,c.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)}#a(e){return f(this.#t)?(this.#t.exitCode=e||0,this.#e.emit("exit",this.#t.exitCode,null),this.#s.call(this.#t,this.#t.exitCode)):0}#l(e,...i){const n=this.#r;if(e==="exit"&&f(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 x=globalThis.process,{onExit:U,load:Y,unload:K}=A(f(x)?new N(x):new M),y=u.stderr.isTTY?u.stderr:u.stdout.isTTY?u.stdout:void 0,V=y?b(()=>{U(()=>{y.write("\x1B[?25h")},{alwaysLast:!0})}):()=>{};var B=Object.defineProperty,l=s((t,e)=>B(t,"name",{value:e,configurable:!0}),"e");const X=l((t=1)=>o+t+"D","cursorBackward"),Q=l((t=1)=>o+t+"B","cursorDown"),Z=l((t=1)=>o+t+"C","cursorForward"),q=o+"?25l",z=o+"G",J=l((t,e)=>{let i="";return t<0?i+=o+-t+"D":t>0&&(i+=o+t+"C"),e<0?i+=o+-e+"A":e>0&&(i+=o+e+"B"),i},"cursorMove"),tt=l((t=1)=>(o+"E").repeat(t),"cursorNextLine"),et=l((t=1)=>(o+"F").repeat(t),"cursorPreviousLine"),it=w?h+"8":h+"u",nt=w?h+"7":h+"s",rt=o+"?25h",st=l((t,e)=>!e&&e!==0?o+(t+1)+"G":o+(e+1)+T+(t+1)+"H","cursorTo"),ot=l((t=1)=>o+t+"A","cursorUp");export{Q as a,Z as b,X as c,q as d,z as e,J as f,tt as g,et as h,it as i,nt as j,rt as k,st as l,ot as m,D as n,V as r};
|