@visulima/pail 3.1.0 → 3.2.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 +59 -0
- package/LICENSE.md +3 -407
- package/README.md +298 -0
- package/dist/constants.d.ts +37 -0
- package/dist/index.browser.d.ts +47 -12
- package/dist/index.browser.js +12 -1
- package/dist/index.server.d.ts +65 -40
- package/dist/index.server.js +533 -2
- package/dist/interactive/index.d.ts +2 -28
- package/dist/interactive/index.js +2 -1
- package/dist/interactive/interactive-manager.d.ts +108 -0
- package/dist/interactive/interactive-stream-hook.d.ts +68 -0
- package/dist/object-tree.d.ts +65 -7
- package/dist/object-tree.js +89 -2
- package/dist/packem_shared/AbstractJsonReporter-intFdT_A.js +204 -0
- package/dist/packem_shared/InteractiveManager-CZ85hGNW.js +172 -0
- package/dist/packem_shared/InteractiveStreamHook-DiSubbJ1.js +21 -0
- package/dist/packem_shared/JsonReporter-C0AXk99i.js +58 -0
- package/dist/packem_shared/JsonReporter-DcM2LBX9.js +28 -0
- package/dist/packem_shared/PrettyReporter-BFWaYP_J.js +222 -0
- package/dist/packem_shared/PrettyReporter-CuLLKr6-.js +169 -0
- package/dist/packem_shared/abstract-pretty-reporter-DMPDCslJ.js +50 -0
- package/dist/packem_shared/constants-DfDr4MHC.js +119 -0
- package/dist/packem_shared/format-label-Btft2KGP.js +1194 -0
- package/dist/packem_shared/get-longest-label-C9PWeyKq.js +9 -0
- package/dist/packem_shared/index-BomQ3E6J.js +650 -0
- package/dist/packem_shared/index-DqKWykfa.js +1146 -0
- package/dist/packem_shared/interactive-stream-hook-DG4BtN12.js +141 -0
- package/dist/packem_shared/pail.browser-CPjQrsyy.js +1427 -0
- package/dist/packem_shared/write-console-log-based-on-level-DBmRYXpj.js +14 -0
- package/dist/packem_shared/write-stream-BG8fhcs3.js +6 -0
- package/dist/pail.browser.d.ts +412 -0
- package/dist/pail.server.d.ts +233 -0
- package/dist/processor/caller/caller-processor.d.ts +40 -7
- package/dist/processor/caller/caller-processor.js +59 -1
- package/dist/processor/caller/get-caller-filename.d.ts +23 -0
- package/dist/processor/message-formatter-processor.d.ts +44 -9
- package/dist/processor/message-formatter-processor.js +67 -1
- package/dist/processor/opentelemetry-processor.d.ts +70 -0
- package/dist/processor/opentelemetry-processor.js +52 -0
- package/dist/processor/redact-processor.d.ts +39 -8
- package/dist/processor/redact-processor.js +30 -1
- package/dist/progress-bar.d.ts +75 -15
- package/dist/progress-bar.js +404 -1
- package/dist/reporter/file/json-file-reporter.d.ts +39 -20
- package/dist/reporter/file/json-file-reporter.js +136 -4
- package/dist/reporter/file/utils/rotating-file-stream.d.ts +48 -0
- package/dist/reporter/http/abstract-http-reporter.d.ts +215 -0
- package/dist/reporter/http/abstract-http-reporter.js +435 -0
- package/dist/reporter/http/http-reporter.d.ts +39 -0
- package/dist/reporter/http/http-reporter.edge-light.d.ts +40 -0
- package/dist/reporter/http/http-reporter.edge-light.js +651 -0
- package/dist/reporter/http/http-reporter.js +13 -0
- package/dist/reporter/http/utils/compression.d.ts +7 -0
- package/dist/reporter/http/utils/log-size-error.d.ts +30 -0
- package/dist/reporter/http/utils/retry.d.ts +27 -0
- package/dist/reporter/json/abstract-json-reporter.d.ts +61 -0
- package/dist/reporter/json/index.browser.d.ts +3 -13
- package/dist/reporter/json/index.browser.js +2 -1
- package/dist/reporter/json/index.d.ts +3 -16
- package/dist/reporter/json/index.js +2 -1
- package/dist/reporter/json/json-reporter.browser.d.ts +40 -0
- package/dist/reporter/json/json-reporter.server.d.ts +50 -0
- package/dist/reporter/pretty/abstract-pretty-reporter.d.ts +83 -0
- package/dist/reporter/pretty/index.browser.d.ts +2 -13
- package/dist/reporter/pretty/index.browser.js +1 -1
- package/dist/reporter/pretty/index.d.ts +2 -25
- package/dist/reporter/pretty/index.js +1 -1
- package/dist/reporter/pretty/pretty-reporter.browser.d.ts +36 -0
- package/dist/reporter/pretty/pretty-reporter.server.d.ts +70 -0
- package/dist/reporter/raw/raw-reporter.browser.d.ts +5 -0
- package/dist/reporter/raw/raw-reporter.server.d.ts +13 -0
- package/dist/reporter/simple/simple-reporter.server.d.ts +10 -14
- package/dist/reporter/simple/simple-reporter.server.js +186 -8
- package/dist/reporter/utils/default-inspector-config.d.ts +3 -0
- package/dist/reporter/utils/format-label.d.ts +3 -0
- package/dist/spinner.d.ts +170 -104
- package/dist/spinner.js +2150 -1
- package/dist/types.d.ts +241 -0
- package/dist/utils/ansi-escapes.d.ts +4 -0
- package/dist/utils/arrayify.d.ts +2 -0
- package/dist/utils/get-longest-badge.d.ts +4 -0
- package/dist/utils/get-longest-label.d.ts +4 -0
- package/dist/utils/merge-types.d.ts +4 -0
- package/dist/utils/stream/safe-stream-handler.d.ts +21 -0
- package/dist/utils/write-console-log-based-on-level.d.ts +4 -0
- package/dist/utils/write-stream.d.ts +2 -0
- package/package.json +53 -4
- package/dist/packem_shared/AbstractJsonReporter-UftN6CIL.js +0 -1
- package/dist/packem_shared/InteractiveManager-CgmJyW9x.js +0 -3
- package/dist/packem_shared/InteractiveStreamHook-NtJu71aN.js +0 -1
- package/dist/packem_shared/JsonReporter-DTBtHNaD.js +0 -2
- package/dist/packem_shared/JsonReporter-Dl4m0xZe.js +0 -1
- package/dist/packem_shared/PrettyReporter-Bns0ZWLy.js +0 -12
- package/dist/packem_shared/PrettyReporter-CGKSTI7X.js +0 -5
- package/dist/packem_shared/abstract-json-reporter-CPsNkpz8.d.ts +0 -22
- package/dist/packem_shared/abstract-pretty-reporter-CUtSm20r.js +0 -1
- package/dist/packem_shared/abstract-pretty-reporter-DB2G-qlI.d.ts +0 -28
- package/dist/packem_shared/constants-DKfCaSUR.js +0 -1
- package/dist/packem_shared/format-label-CpyyTBom.js +0 -26
- package/dist/packem_shared/get-longest-label-B0NrI-o2.js +0 -1
- package/dist/packem_shared/index-CysYvHXs.js +0 -8
- package/dist/packem_shared/index-D9hWq9ka.js +0 -1
- package/dist/packem_shared/index.d-BR1GjZri.d.ts +0 -53
- package/dist/packem_shared/index.d-oxZvg_y7.d.ts +0 -20
- package/dist/packem_shared/interactive-stream-hook-CeVo4Kth.js +0 -2
- package/dist/packem_shared/pail.browser-BmHoDvEA.js +0 -19
- package/dist/packem_shared/pail.browser-CmWcqnn9.d.ts +0 -64
- package/dist/packem_shared/types-DVzG8TWL.d.ts +0 -95
- package/dist/packem_shared/write-console-log-based-on-level-BP95fgQZ.js +0 -1
- package/dist/packem_shared/write-stream-CD8XFv1L.js +0 -1
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
var $e=Object.defineProperty;var g=(e,i)=>$e(e,"name",{value:i,configurable:!0});import{createRequire as Se}from"node:module";const We=Se(import.meta.url),y=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ee=g(e=>{if(typeof y<"u"&&y.versions&&y.versions.node){const[i,r]=y.versions.node.split(".").map(Number);if(i>22||i===22&&r>=3||i===20&&r>=16)return y.getBuiltinModule(e)}return We(e)},"__cjs_getBuiltinModule"),B=y,{execFileSync:ye}=ee("node:child_process"),T=ee("node:fs"),Be=ee("node:tty");var ke=Object.defineProperty,Ie=g((e,i)=>ke(e,"name",{value:i,configurable:!0}),"p$1"),Fe=Object.defineProperty,de=Ie((e,i)=>Fe(e,"name",{value:i,configurable:!0}),"R"),Oe=Object.defineProperty,je=de((e,i)=>Oe(e,"name",{value:i,configurable:!0}),"E");const he=String.raw,ae=he`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,Ne=je(()=>new RegExp(he`\p{RI}{2}|(?)${ae}(?:\u200D${ae})*`,"gu"),"default");var Re=Object.defineProperty,Te=de((e,i)=>Re(e,"name",{value:i,configurable:!0}),"p");const k=new Set(["\x1B",""]),D="\x07",fe="[",ie="m",L="]8;;",_e=39,Ce=/[\u200B\uFEFF\u2060-\u2064]/g,Pe=new RegExp(`(?:\\${fe}(?<code>\\d+)m|\\${L}(?<uri>.*)${D})`),Me=Object.freeze(new Map([[0,0],[1,22],[2,22],[3,23],[4,24],[7,27],[8,28],[9,29],[30,39],[31,39],[32,39],[33,39],[34,39],[35,39],[36,39],[37,39],[40,49],[41,49],[42,49],[43,49],[44,49],[45,49],[46,49],[47,49],[90,39]])),I=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\))/g,_=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,M=Ne();Te(e=>e.replace(M,""),"stripEmoji");var He=Object.defineProperty,x=g((e,i)=>He(e,"name",{value:i,configurable:!0}),"f$1"),qe=Object.defineProperty,b=x((e,i)=>qe(e,"name",{value:i,configurable:!0}),"c"),Le=Object.defineProperty,K=b((e,i)=>Le(e,"name",{value:i,configurable:!0}),"E$1");function F(e){return e===161||e===164||e===167||e===168||e===170||e===173||e===174||e>=176&&e<=180||e>=182&&e<=186||e>=188&&e<=191||e===198||e===208||e===215||e===216||e>=222&&e<=225||e===230||e>=232&&e<=234||e===236||e===237||e===240||e===242||e===243||e>=247&&e<=250||e===252||e===254||e===257||e===273||e===275||e===283||e===294||e===295||e===299||e>=305&&e<=307||e===312||e>=319&&e<=322||e===324||e>=328&&e<=331||e===333||e===338||e===339||e===358||e===359||e===363||e===462||e===464||e===466||e===468||e===470||e===472||e===474||e===476||e===593||e===609||e===708||e===711||e>=713&&e<=715||e===717||e===720||e>=728&&e<=731||e===733||e===735||e>=768&&e<=879||e>=913&&e<=929||e>=931&&e<=937||e>=945&&e<=961||e>=963&&e<=969||e===1025||e>=1040&&e<=1103||e===1105||e===8208||e>=8211&&e<=8214||e===8216||e===8217||e===8220||e===8221||e>=8224&&e<=8226||e>=8228&&e<=8231||e===8240||e===8242||e===8243||e===8245||e===8251||e===8254||e===8308||e===8319||e>=8321&&e<=8324||e===8364||e===8451||e===8453||e===8457||e===8467||e===8470||e===8481||e===8482||e===8486||e===8491||e===8531||e===8532||e>=8539&&e<=8542||e>=8544&&e<=8555||e>=8560&&e<=8569||e===8585||e>=8592&&e<=8601||e===8632||e===8633||e===8658||e===8660||e===8679||e===8704||e===8706||e===8707||e===8711||e===8712||e===8715||e===8719||e===8721||e===8725||e===8730||e>=8733&&e<=8736||e===8739||e===8741||e>=8743&&e<=8748||e===8750||e>=8756&&e<=8759||e===8764||e===8765||e===8776||e===8780||e===8786||e===8800||e===8801||e>=8804&&e<=8807||e===8810||e===8811||e===8814||e===8815||e===8834||e===8835||e===8838||e===8839||e===8853||e===8857||e===8869||e===8895||e===8978||e>=9312&&e<=9449||e>=9451&&e<=9547||e>=9552&&e<=9587||e>=9600&&e<=9615||e>=9618&&e<=9621||e===9632||e===9633||e>=9635&&e<=9641||e===9650||e===9651||e===9654||e===9655||e===9660||e===9661||e===9664||e===9665||e>=9670&&e<=9672||e===9675||e>=9678&&e<=9681||e>=9698&&e<=9701||e===9711||e===9733||e===9734||e===9737||e===9742||e===9743||e===9756||e===9758||e===9792||e===9794||e===9824||e===9825||e>=9827&&e<=9829||e>=9831&&e<=9834||e===9836||e===9837||e===9839||e===9886||e===9887||e===9919||e>=9926&&e<=9933||e>=9935&&e<=9939||e>=9941&&e<=9953||e===9955||e===9960||e===9961||e>=9963&&e<=9969||e===9972||e>=9974&&e<=9977||e===9979||e===9980||e===9982||e===9983||e===10045||e>=10102&&e<=10111||e>=11094&&e<=11097||e>=12872&&e<=12879||e>=57344&&e<=63743||e>=65024&&e<=65039||e===65533||e>=127232&&e<=127242||e>=127248&&e<=127277||e>=127280&&e<=127337||e>=127344&&e<=127373||e===127375||e===127376||e>=127387&&e<=127404||e>=917760&&e<=917999||e>=983040&&e<=1048573||e>=1048576&&e<=1114109}g(F,"M$1");x(F,"M");b(F,"A");K(F,"isAmbiguous");function O(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}g(O,"A$1");x(O,"C");b(O,"D$1");K(O,"isFullWidth");function j(e){return e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9776&&e<=9783||e>=9800&&e<=9811||e===9855||e>=9866&&e<=9871||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e>=94192&&e<=94198||e>=94208&&e<=101589||e>=101631&&e<=101662||e>=101760&&e<=101874||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128728||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129674||e>=129678&&e<=129734||e===129736||e>=129741&&e<=129756||e>=129759&&e<=129770||e>=129775&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}g(j,"N$2");x(j,"T");b(j,"C");K(j,"isWide");function V(e){return F(e)?"ambiguous":O(e)?"fullwidth":e===8361||e>=65377&&e<=65470||e>=65474&&e<=65479||e>=65482&&e<=65487||e>=65490&&e<=65495||e>=65498&&e<=65500||e>=65512&&e<=65518?"halfwidth":e>=32&&e<=126||e===162||e===163||e===165||e===166||e===172||e===175||e>=10214&&e<=10221||e===10629||e===10630?"narrow":j(e)?"wide":"neutral"}g(V,"F");x(V,"R");b(V,"t");K(V,"getCategory");var De=Object.defineProperty,re=b((e,i)=>De(e,"name",{value:i,configurable:!0}),"e");function N(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}g(N,"j$1");x(N,"O");b(N,"r");re(N,"validate");function R(e){return N(e),V(e)}g(R,"y$2");x(R,"v");b(R,"eastAsianWidthType");re(R,"eastAsianWidthType");function ne(e,{ambiguousAsWide:i=!1}={}){return N(e),O(e)||j(e)||i&&F(e)?2:1}g(ne,"Y$1");x(ne,"J");b(ne,"eastAsianWidth");re(ne,"eastAsianWidth");var Ke=Object.defineProperty,z=b((e,i)=>Ke(e,"name",{value:i,configurable:!0}),"b");const ue=new Map,C=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,H=z(e=>e>=32&&e<=126?"latin":e===8203||e===8204||e===8205||e===8288?"zero":e<=31||e>=127&&e<=159?"control":e>=160&&e<=255||e>=9472&&e<=9599?"latin":e>=4352&&e<=4607||e>=11904&&e<=40959||e>=44032&&e<=55215||e>=63744&&e<=64255||e>=65280&&e<=65519&&!(e>=65377&&e<=65439)||e>=12352&&e<=12543?"wide":e===8230?"latin":"other","getCharType"),Ve=z((e,i)=>{const r=Math.floor(e/65536),s=e%65536;let l=ue.get(r);if(l||(l=new Map,ue.set(r,l)),l.has(s))return l.get(s);let u;if(H(e)==="latin")u=i.width.regular;else if(H(e)==="control")u=i.width.control;else if(H(e)==="wide")u=i.width.wide;else switch(R(e)){case"ambiguous":{u=i.width.ambiguousIsNarrow?i.width.regular:i.width.wide;break}case"fullwidth":{u=i.width.fullWidth;break}case"wide":{u=i.width.wide;break}default:u=i.width.regular}return l.set(s,u),u},"getCachedCharWidth"),ze=z(e=>e>=768&&e<=879||e>=6832&&e<=6911||e>=7616&&e<=7679||e>=8400&&e<=8447||e>=65056&&e<=65071||e>=917760&&e<=917999||e>=65024&&e<=65039||e>=3633&&e<=3642||e>=3655&&e<=3662||e>=3761&&e<=3769||e>=3771&&e<=3772||e>=3784&&e<=3789||e>=2304&&e<=2307||e>=2362&&e<=2383||e>=2385&&e<=2391||e>=2402&&e<=2403||e>=2433&&e<=2435||e>=2492&&e<=2500||e>=2509&&e<=2509||e>=2561&&e<=2563||e>=2620&&e<=2637||e>=1611&&e<=1631||e>=1648&&e<=1648||e>=1750&&e<=1773||e>=2276&&e<=2302||e>=1425&&e<=1469||e>=1471&&e<=1471||e>=1473&&e<=1474||e>=1476&&e<=1477||e>=1479&&e<=1479||e>=3893&&e<=3893||e>=3895&&e<=3895||e>=3897&&e<=3897||e>=3953&&e<=3966||e>=3968&&e<=3972||e>=3974&&e<=3975?!0:e>=768&&e<=777||e>=803&&e<=803,"isCombiningCharacter"),Q=z((e,i={})=>{if(!e||e.length===0)return{ellipsed:!1,index:0,truncated:!1,width:0};const r={truncation:{countAnsiEscapeCodes:i.countAnsiEscapeCodes??!1,ellipsis:i.ellipsis??"",ellipsisWidth:i.ellipsisWidth??(i.ellipsis?Q(i.ellipsis,{...i,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width:0),limit:i.limit??Number.POSITIVE_INFINITY},width:{ambiguousIsNarrow:i.ambiguousIsNarrow??!1,ansi:i.ansiWidth??0,control:i.controlWidth??0,emoji:i.emojiWidth??2,fullWidth:i.fullWidth??2,halfWidth:i.halfWidth??1,regular:i.regularWidth??1,tab:i.tabWidth??8,wide:i.wideWidth??2}},s=Math.max(0,r.truncation.limit-r.truncation.ellipsisWidth),{length:l}=e,u=l>1e4;let n=0,a=0,o=l,d=!1;const c=e.includes("\x1B")||e.includes("");for(;n<l;){if(c&&(e[n]==="\x1B"||e[n]==="")){if(e.startsWith("\x1B]8;;",n)){const t="\x1B]8;;\x07",A=t.length,G=e.indexOf("\x07",n+5);if(G!==-1){const U=e.indexOf(t,G+1);if(U!==-1){const xe=U+A,Ae=e.slice(G+1,U).replace(I,""),se=Q(Ae,{ambiguousIsNarrow:r.width.ambiguousIsNarrow,ansiWidth:r.width.ansi,controlWidth:r.width.control,countAnsiEscapeCodes:!1,ellipsis:r.truncation.ellipsis,ellipsisWidth:r.truncation.ellipsisWidth,emojiWidth:r.width.emoji,fullWidth:r.width.fullWidth,halfWidth:r.width.halfWidth,limit:Math.max(0,s-a),regularWidth:r.width.regular,tabWidth:r.width.tab,wideWidth:r.width.wide}),Y=se.width;if(se.truncated)d=!0,o=Math.min(o,n);else if(a+Y>s&&(o=Math.min(o,n),d=!0,a+Y>r.truncation.limit))break;if(a+=Y,n=xe,d&&a>=r.truncation.limit)break;continue}}}if(I.lastIndex=n,I.test(e)){const t=I.lastIndex-n,A=r.truncation.countAnsiEscapeCodes?t:r.width.ansi;if(a+A>s&&(o=Math.min(o,n),a+A>r.truncation.limit)){d=!0;break}a+=A,n=I.lastIndex;continue}}const f=e.codePointAt(n);if(f===8203||f===65279||f>=8288&&f<=8292){n+=1;continue}if(f===9){if(a+r.width.tab>s&&(o=Math.min(o,n),a+r.width.tab>r.truncation.limit)){d=!0;break}a+=r.width.tab,n+=1;continue}if(C.lastIndex=n,C.test(e)){const t=(C.lastIndex-n)*r.width.regular;if(a+t>s){const A=Math.floor((s-a)/r.width.regular);if(o=Math.min(o,n+A),a+t>r.truncation.limit){d=!0;break}}a+=t,n=C.lastIndex;continue}if((f<=31||f>=127&&f<=159)&&(_.lastIndex=n,_.test(e))){const t=(_.lastIndex-n)*r.width.control;if(a+t>s&&(o=Math.min(o,n+Math.floor((s-a)/r.width.control)),a+t>r.truncation.limit)){d=!0;break}a+=t,n=_.lastIndex;continue}if(M.lastIndex=n,M.test(e)){if(a+r.width.emoji>s&&(o=Math.min(o,n),a+r.width.emoji>r.truncation.limit)){d=!0;break}a+=r.width.emoji,n=M.lastIndex;continue}const m=e.codePointAt(n)??0;if(ze(m)){n+=m>65535?2:1;continue}let p;if(u)p=Ve(m,r);else switch(H(m)){case"control":{p=r.width.control;break}case"latin":{p=r.width.regular;break}case"wide":{p=r.width.wide;break}case"zero":{p=0;break}default:switch(R(m)){case"ambiguous":{p=r.width.ambiguousIsNarrow?r.width.regular:r.width.wide;break}case"fullwidth":{p=r.width.fullWidth;break}case"wide":{p=r.width.wide;break}default:p=r.width.regular}}if(a+p>s&&(o=Math.min(o,n),a+p>r.truncation.limit)){d=!0;break}a+=p,n+=m>65535?2:1}let h=a,w=!1;return d&&r.truncation.limit>=r.truncation.ellipsisWidth&&(h=r.truncation.limit,w=!0),{ellipsed:w,index:d?o:l,truncated:d,width:h}},"getStringTruncatedWidth");var Ge=Object.defineProperty,Ue=g((e,i)=>Ge(e,"name",{value:i,configurable:!0}),"i$1"),Ye=Object.defineProperty,Je=Ue((e,i)=>Ye(e,"name",{value:i,configurable:!0}),"e"),Ze=Object.defineProperty,Qe=Je((e,i)=>Ze(e,"name",{value:i,configurable:!0}),"r");const v=Qe((e,i={})=>Q(e,{...i,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,"getStringWidth");var Xe=Object.defineProperty,pe=g((e,i)=>Xe(e,"name",{value:i,configurable:!0}),"x"),ei=Object.defineProperty,S=pe((e,i)=>ei(e,"name",{value:i,configurable:!0}),"m"),ii=Object.defineProperty,ri=S((e,i)=>ii(e,"name",{value:i,configurable:!0}),"n");class me{static{g(this,"T")}static{pe(this,"w")}static{S(this,"u")}static{ri(this,"AnsiStateTracker")}activeForeground=null;activeBackground=null;activeFormatting=[];processEscape(i){const r=/\x1B\[(\d+)m/.exec(i);if(!r)return;const s=Number.parseInt(r[1],10);switch(s){case 0:{this.activeForeground=null,this.activeBackground=null,this.activeFormatting=[];break}case 39:{this.activeForeground=null;break}case 49:{this.activeBackground=null;break}default:if(s>=30&&s<=37||s>=90&&s<=97)this.activeForeground=i;else if(s>=40&&s<=47||s>=100&&s<=107)this.activeBackground=i;else if([1,2,3,4,7,8,9].includes(s))this.activeFormatting.push(i);else if([22,23,24,27,28,29].includes(s)){const l={22:"[1m",23:"[3m",24:"[4m",27:"[7m",28:"[8m",29:"[9m"}[s];l&&(this.activeFormatting=this.activeFormatting.filter(u=>!u.includes(l)))}}}getStartEscapesForAllActiveAttributes(){return[this.activeBackground,this.activeForeground,...this.activeFormatting].filter(Boolean).join("")}getEndEscapesForAllActiveAttributes(){const i=[];if(this.activeFormatting.length>0){const r={"\x1B[1m":"\x1B[22m","\x1B[2m":"\x1B[22m","\x1B[3m":"\x1B[23m","\x1B[4m":"\x1B[24m","\x1B[7m":"\x1B[27m","\x1B[8m":"\x1B[28m","\x1B[9m":"\x1B[29m"};[...this.activeFormatting].reverse().forEach(s=>{const l=r[s];l&&i.push(l)})}return this.activeForeground&&i.push("\x1B[39m"),this.activeBackground&&i.push("\x1B[49m"),i.join("")}}var ni=Object.defineProperty,ge=S((e,i)=>ni(e,"name",{value:i,configurable:!0}),"o");const te=ge((e,i)=>{if(!k.has(e[i]))return{isInsideEscape:!1,isInsideLinkEscape:!1};const r=!0,s=e.slice(i+1,i+1+L.length).join("")===L;return{isInsideEscape:r,isInsideLinkEscape:s}},"checkEscapeSequence"),si=ge((e,i={})=>{const r=new me;let s="",l=!1,u=!1,n="",a="",o=!1;const d=[...e];for(let c=0;c<d.length;c++){const h=d[c];if(h&&k.has(h)){if(s){const m=i.getWidth?.(s)??0,p={isEscapeSequence:!1,isGrapheme:!0,text:s,width:m};if(o&&(p.isHyperlink=!0,p.hyperlinkUrl=a),i.onSegment?.(p,r)===!1)return;s=""}if(l=!0,n=h,u=te(d,c).isInsideLinkEscape,u){let m=c+1;for(a="";m<d.length;){const t=d[m];if(t===D)break;a+=t,m+=1}a=a.slice(4);const p={hyperlinkUrl:a,isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkStart:!0,width:0};if(i.onSegment?.(p,r)===!1)return;c=m,o=!0,l=!1,u=!1,n="";continue}if(c+1<d.length&&d[c+1]==="\\"&&o){const m={isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkEnd:!0,width:0};if(i.onSegment?.(m,r)===!1)return;o=!1,a="",c+=1,l=!1,n="";continue}}if(l){if(n!==h&&(n+=h),h===ie){l=!1,r.processEscape(n);const m={isEscapeSequence:!0,isGrapheme:!1,text:n,width:0};if(i.onSegment?.(m,r)===!1)return;n=""}continue}s+=h;const w=i.getWidth?.(s)??0,f={isEscapeSequence:!1,isGrapheme:!0,text:s,width:w};if(o&&(f.isHyperlink=!0,f.hyperlinkUrl=a),i.onSegment?.(f,r)===!1)return;s=""}if(s){const c=i.getWidth?.(s)??0,h={isEscapeSequence:!1,isGrapheme:!0,text:s,width:c};o&&(h.isHyperlink=!0,h.hyperlinkUrl=a),i.onSegment?.(h,r)}if(n){const c={isEscapeSequence:!0,isGrapheme:!1,text:n,width:0};i.onSegment?.(c,r)}},"processAnsiString");var ai=Object.defineProperty,ui=S((e,i)=>ai(e,"name",{value:i,configurable:!0}),"t$1");const oe=ui(e=>`${k.values().next().value}${fe}${e}${ie}`,"wrapAnsiCode");var oi=Object.defineProperty,li=S((e,i)=>oi(e,"name",{value:i,configurable:!0}),"t");const le=li(e=>`${k.values().next().value}${L}${e}${D}`,"wrapAnsiHyperlink");var ci=Object.defineProperty,di=S((e,i)=>ci(e,"name",{value:i,configurable:!0}),"l");const hi=di(e=>{if(e.length===0)return"";if(e.length===1)return e[0];let i="",r,s;const l=e.join(`
|
|
2
|
-
`),u=[...l];let n=0;for(const[a,o]of u.entries()){if(i+=o,k.has(o)){const c=Pe.exec(l.slice(n))?.groups??{};if(c.code!==void 0){const h=Number.parseFloat(c.code);r=h===_e?void 0:h}else c.uri!==void 0&&(s=c.uri.length===0?void 0:c.uri)}const d=Me.get(Number(r));u[a+1]===`
|
|
3
|
-
`?(s&&(i+=le("")),r&&d&&(i+=oe(d))):o===`
|
|
4
|
-
`&&(r&&d&&(i+=oe(r)),s&&(i+=le(s))),n+=o.length}return i},"preserveAnsi");var fi=Object.defineProperty,E=S((e,i)=>fi(e,"name",{value:i,configurable:!0}),"h");const J=E(e=>{if(!e.includes("\x1B"))return e;let i=e;return e.includes("\x1B[30m")&&(i+="\x1B[39m"),e.includes("\x1B[42m")&&(i+="\x1B[49m"),i},"resetAnsiAtLineBreak"),$=E(e=>{const i=e.split(" ");let r=i.length;for(;r>0&&v(i[r-1])===0;)r--;return r===i.length?e:i.slice(0,r).join(" ")+i.slice(r).join("")},"stringVisibleTrimSpacesRight"),we=E((e,i,r)=>{if(e.length===0)return[""];if(i<=0)return[e];const s=[],l=new me;let u="",n=0,a=!1,o=!1,d="";for(let c=0;c<e.length;c++){const h=e[c];if(k.has(h)){a=!0,d=h,u+=h,o=te([...e],c).isInsideLinkEscape;continue}if(a){d+=h,u+=h,o?h===D&&(a=o=!1):h===ie&&(a=!1,l.processEscape(d));continue}const w=v(h),f=h===" ";if(w===0){u+=h;continue}if(n+w>i&&(u&&s.push(u+l.getEndEscapesForAllActiveAttributes()),u=l.getStartEscapesForAllActiveAttributes(),n=v(u),f&&r)){for(;c<e.length&&e[c]===" "&&(c+=1,!(c>=e.length)););c<e.length&&c--;continue}if(u+=h,n+=w,n===i&&c<e.length-1&&(s.push(u+l.getEndEscapesForAllActiveAttributes()),u=l.getStartEscapesForAllActiveAttributes(),n=v(u),c+1<e.length&&e[c+1]===" "&&r)){for(c+=1;c<e.length&&e[c]===" ";)c+=1;c--}}return u&&s.push(u+l.getEndEscapesForAllActiveAttributes()),r?s.map(c=>$(c)):s},"wrapWithBreakAtWidth"),pi=E((e,i,r)=>{if(e.length===0)return[];const s=r?e.trim():e;if(s.length===0)return[];const l=[];let u="",n=0;return si(s,{getWidth:v,onSegment:E((a,o)=>{if(a.isEscapeSequence)u+=a.text;else{const d=a.text===" ";if(a.width===0)return u+=a.text,!0;if(n+a.width>i&&(u&&l.push(u),u=o.getStartEscapesForAllActiveAttributes(),n=0,d))return r||l.push(o.getStartEscapesForAllActiveAttributes()+a.text),!0;u+=a.text,n+=a.width}return!0},"onSegment")}),u&&l.push(u),r?l.map(a=>$(a)):l},"wrapCharByChar"),mi=E((e,i,r)=>{if(e.length===0)return[];const s=r?e.trim():e;if(s.length===0)return[];const l=s.split(/(?=\s)|(?<=\s)/),u=[];let n="",a=0,o=0;for(;o<l.length;){const d=l[o],c=/^\s+$/.test(d),h=v(d);if(d.length===0){o+=1;continue}if(r&&c&&a===0){o+=1;continue}if(a+h>i&&a>0){r?u.push($(n)):u.push(n),n="",a=0;continue}n+=d,a+=h,o+=1}return n&&(r?u.push($(n)):u.push(n)),u},"wrapWithWordBoundaries"),gi=E((e,i,r)=>{if(e.length===0)return[];const s=r?e.trim():e;if(s.length===0)return[];const l=s.split(/(?=\s)|(?<=\s)/),u=[];let n="",a=0,o=0;for(;o<l.length;){const d=l[o],c=/^\s+$/.test(d),h=v(d);if(d.length===0){o+=1;continue}if(r&&c&&a===0){o+=1;continue}if(h>i){n&&u.push(J(r?$(n):n));const w=we(d,i,r);if(w.length>0){for(let f=0;f<w.length-1;f++)u.push(w[f]);n=w[w.length-1],a=v(n)}else n="",a=0;o+=1;continue}if(a+h>i&&a>0&&(u.push(J(r?$(n):n)),n="",a=0,r&&c)){o+=1;continue}n+=d,a+=h,o+=1}return n&&u.push(J(r?$(n):n)),u},"wrapAndBreakWords"),P={BREAK_AT_CHARACTERS:"BREAK_AT_CHARACTERS",BREAK_WORDS:"BREAK_WORDS",PRESERVE_WORDS:"PRESERVE_WORDS",STRICT_WIDTH:"STRICT_WIDTH"},xi=E((e,i={})=>{const{removeZeroWidthCharacters:r=!0,trim:s=!0,width:l=80,wrapMode:u=P.PRESERVE_WORDS}=i;if(s&&e.trim()==="")return"";let n=String(e).normalize("NFC").replaceAll(`\r
|
|
5
|
-
`,`
|
|
6
|
-
`);return r&&(n=n.replaceAll(Ce,"")),n.split(`
|
|
7
|
-
`).map(a=>{if(s&&a.trim()==="")return"";let o;switch(u){case P.BREAK_AT_CHARACTERS:{o=pi(a,l,s);break}case P.BREAK_WORDS:{o=gi(a,l,s);break}case P.STRICT_WIDTH:{o=we(a,l,s);break}default:o=mi(a,l,s)}return hi(o)}).join(`
|
|
8
|
-
`)},"wordWrap");var ti=Object.defineProperty,W=g((e,i)=>ti(e,"name",{value:i,configurable:!0}),"e");const be=80,ve=24,X=W((e,i,{shell:r,env:s}={})=>ye(e,i,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:500,shell:r,env:s}).trim(),"exec"),q=W((e,i)=>({columns:Number.parseInt(e,10),rows:Number.parseInt(i,10)}),"create"),Ee=W((e,i)=>{const{columns:r,rows:s}=q(e,i);if(!(Number.isNaN(r)||Number.isNaN(s))&&!(r===be&&s===ve))return{columns:r,rows:s}},"createIfNotDefault");function wi(){const{env:e,stdout:i,stderr:r}=B;if(i?.columns&&i?.rows)return q(i.columns,i.rows);if(r?.columns&&r?.rows)return q(r.columns,r.rows);if(e.COLUMNS&&e.LINES)return q(e.COLUMNS,e.LINES);const s={columns:be,rows:ve};return B.platform==="win32"?Z()??s:B.platform==="darwin"?ce()??Z()??s:ce()??Z()??bi()??s}g(wi,"O");W(wi,"terminalSize");const ce=W(()=>{try{const e=B.platform==="darwin"?T.constants.O_EVTONLY|T.constants.O_NONBLOCK:T.constants.O_NONBLOCK,{columns:i,rows:r}=Be.WriteStream(T.openSync("/dev/tty",e));return{columns:i,rows:r}}catch{}},"devTty"),Z=W(()=>{try{const e=X("tput",["cols"],{env:{TERM:"dumb",...B.env}}),i=X("tput",["lines"],{env:{TERM:"dumb",...B.env}});if(e&&i)return Ee(e,i)}catch{}},"tput"),bi=W(()=>{try{const e=X("resize",["-u"]).match(/\d+/g);if(e.length===2)return Ee(e[0],e[1])}catch{}},"resize");export{P as B,wi as O,xi as i,v as o};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var v=Object.defineProperty;var x=(e,r)=>v(e,"name",{value:r,configurable:!0});var A=Object.defineProperty,D=x((e,r)=>A(e,"name",{value:r,configurable:!0}),"x"),C=Object.defineProperty,B=D((e,r)=>C(e,"name",{value:r,configurable:!0}),"h"),M=Object.defineProperty,m=B((e,r)=>M(e,"name",{value:r,configurable:!0}),"m$1");const y=new Map([["aliceblue","#f0f8ff"],["antiquewhite","#faebd7"],["aqua","#00ffff"],["aquamarine","#7fffd4"],["azure","#f0ffff"],["beige","#f5f5dc"],["bisque","#ffe4c4"],["black","#000000"],["blanchedalmond","#ffebcd"],["blue","#0000ff"],["blueviolet","#8a2be2"],["brown","#a52a2a"],["burlywood","#deb887"],["cadetblue","#5f9ea0"],["chartreuse","#7fff00"],["chocolate","#d2691e"],["coral","#ff7f50"],["cornflowerblue","#6495ed"],["cornsilk","#fff8dc"],["crimson","#dc143c"],["cyan","#00ffff"],["darkblue","#00008b"],["darkcyan","#008b8b"],["darkgoldenrod","#b8860b"],["darkgray","#a9a9a9"],["darkgreen","#006400"],["darkgrey","#a9a9a9"],["darkkhaki","#bdb76b"],["darkmagenta","#8b008b"],["darkolivegreen","#556b2f"],["darkorange","#ff8c00"],["darkorchid","#9932cc"],["darkred","#8b0000"],["darksalmon","#e9967a"],["darkseagreen","#8fbc8f"],["darkslateblue","#483d8b"],["darkslategray","#2f4f4f"],["darkslategrey","#2f4f4f"],["darkturquoise","#00ced1"],["darkviolet","#9400d3"],["deeppink","#ff1493"],["deepskyblue","#00bfff"],["dimgray","#696969"],["dimgrey","#696969"],["dodgerblue","#1e90ff"],["firebrick","#b22222"],["floralwhite","#fffaf0"],["forestgreen","#228b22"],["fuchsia","#ff00ff"],["gainsboro","#dcdcdc"],["ghostwhite","#f8f8ff"],["gold","#ffd700"],["goldenrod","#daa520"],["gray","#808080"],["green","#008000"],["greenyellow","#adff2f"],["grey","#808080"],["honeydew","#f0fff0"],["hotpink","#ff69b4"],["indianred","#cd5c5c"],["indigo","#4b0082"],["ivory","#fffff0"],["khaki","#f0e68c"],["lavender","#e6e6fa"],["lavenderblush","#fff0f5"],["lawngreen","#7cfc00"],["lemonchiffon","#fffacd"],["lightblue","#add8e6"],["lightcoral","#f08080"],["lightcyan","#e0ffff"],["lightgoldenrodyellow","#fafad2"],["lightgray","#d3d3d3"],["lightgreen","#90ee90"],["lightgrey","#d3d3d3"],["lightpink","#ffb6c1"],["lightsalmon","#ffa07a"],["lightseagreen","#20b2aa"],["lightskyblue","#87cefa"],["lightslategray","#778899"],["lightslategrey","#778899"],["lightsteelblue","#b0c4de"],["lightyellow","#ffffe0"],["lime","#00ff00"],["limegreen","#32cd32"],["linen","#faf0e6"],["magenta","#ff00ff"],["maroon","#800000"],["mediumaquamarine","#66cdaa"],["mediumblue","#0000cd"],["mediumorchid","#ba55d3"],["mediumpurple","#9370db"],["mediumseagreen","#3cb371"],["mediumslateblue","#7b68ee"],["mediumspringgreen","#00fa9a"],["mediumturquoise","#48d1cc"],["mediumvioletred","#c71585"],["midnightblue","#191970"],["mintcream","#f5fffa"],["mistyrose","#ffe4e1"],["moccasin","#ffe4b5"],["navajowhite","#ffdead"],["navy","#000080"],["oldlace","#fdf5e6"],["olive","#808000"],["olivedrab","#6b8e23"],["orange","#ffa500"],["orangered","#ff4500"],["orchid","#da70d6"],["palegoldenrod","#eee8aa"],["palegreen","#98fb98"],["paleturquoise","#afeeee"],["palevioletred","#db7093"],["papayawhip","#ffefd5"],["peachpuff","#ffdab9"],["peru","#cd853f"],["pink","#ffc0cb"],["plum","#dda0dd"],["powderblue","#b0e0e6"],["purple","#800080"],["rebeccapurple","#663399"],["red","#ff0000"],["rosybrown","#bc8f8f"],["royalblue","#4169e1"],["saddlebrown","#8b4513"],["salmon","#fa8072"],["sandybrown","#f4a460"],["seagreen","#2e8b57"],["seashell","#fff5ee"],["sienna","#a0522d"],["silver","#c0c0c0"],["skyblue","#87ceeb"],["slateblue","#6a5acd"],["slategray","#708090"],["slategrey","#708090"],["snow","#fffafa"],["springgreen","#00ff7f"],["steelblue","#4682b4"],["tan","#d2b48c"],["teal","#008080"],["thistle","#d8bfd8"],["tomato","#ff6347"],["turquoise","#40e0d0"],["violet","#ee82ee"],["wheat","#f5deb3"],["white","#ffffff"],["whitesmoke","#f5f5f5"],["yellow","#ffff00"],["yellowgreen","#9acd32"]]),P=/^#([\dA-F]{2})([\dA-F]{2})([\dA-F]{2})([\dA-F]{2})?$/i,N=/^#([\dA-F])([\dA-F])([\dA-F])([\dA-F])?$/i,L=/^rgba?\(\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*(,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*)?\)$/,j=/^hsla?\(\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))%\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))%\s*(,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*)?\)$/,$=m(()=>({__proto__:null,backgroundColor:null,color:null,fontStyle:null,fontWeight:null,textDecorationColor:null,textDecorationLine:[]}),"getDefaultCss"),p=/\s+/g,g=m(e=>{y.has(e)&&(e=y.get(e));const r=P.exec(e);if(r)return[Number.parseInt(r[1],16),Number.parseInt(r[2],16),Number.parseInt(r[3],16)];const t=N.exec(e);if(t)return[Number.parseInt(`${t[1]}${t[1]}`,16),Number.parseInt(`${t[2]}${t[2]}`,16),Number.parseInt(`${t[3]}${t[3]}`,16)];const f=L.exec(e);if(f)return[Math.round(Math.max(0,Math.min(255,Number(f[1])))),Math.round(Math.max(0,Math.min(255,Number(f[2])))),Math.round(Math.max(0,Math.min(255,Number(f[3]))))];const i=j.exec(e);if(i){let o=Number(i[1])%360;o<0&&(o+=360);const l=Math.max(0,Math.min(100,Number(i[2])))/100,n=Math.max(0,Math.min(100,Number(i[3])))/100,c=(1-Math.abs(2*n-1))*l,u=c*(1-Math.abs(o/60%2-1)),a=n-c/2;let s,d,b;return o<60?{0:s,1:d,2:b}=[c,u,0]:o<120?{0:s,1:d,2:b}=[u,c,0]:o<180?{0:s,1:d,2:b}=[0,c,u]:o<240?{0:s,1:d,2:b}=[0,u,c]:o<300?{0:s,1:d,2:b}=[u,0,c]:{0:s,1:d,2:b}=[c,0,u],[Math.round((s+a)*255),Math.round((d+a)*255),Math.round((b+a)*255)]}return null},"parseCssColor"),h=m((e,r)=>e?.[0]===r?.[0]&&e?.[1]===r?.[1]&&e?.[2]===r?.[2],"colorEquals"),F=m(e=>{const r=$(),t=[];let f=!1,i=null,o=0,l="";for(const n of e){if(n==="(")o++;else if(o>0)n===")"&&o--;else if(f){if(n===";"){const c=l.trim();c!==""&&t.push([i,c]),i=null,l="",f=!1;continue}}else if(n===":"){i=l.trim(),l="",f=!0;continue}l+=n}if(f&&o===0){const n=l.trim();n!==""&&t.push([i,n]),i=null,l=""}for(const{0:n,1:c}of t)switch(n){case"background-color":{c!=null&&(r.backgroundColor=c);break}case"color":{c!=null&&(r.color=c);break}case"font-style":{["italic","oblique","oblique 14deg"].includes(c)&&(r.fontStyle="italic");break}case"font-weight":{c==="bold"&&(r.fontWeight=c);break}case"text-decoration":{r.textDecorationColor=null,r.textDecorationLine=[];const u=c.split(p);for(const a of u){const s=g(a);s!=null?r.textDecorationColor=s:["line-through","overline","underline"].includes(a)&&r.textDecorationLine.push(a)}break}case"text-decoration-color":{const u=g(c);u!=null&&(r.textDecorationColor=u);break}case"text-decoration-line":{r.textDecorationLine=[];const u=c.split(p);for(const a of u)["line-through","overline","underline"].includes(a)&&r.textDecorationLine.push(a);break}}return r},"parseCss"),q=m((e,r=null)=>{r=r??$();let t="";if(!h(e.backgroundColor,r.backgroundColor))if(e.backgroundColor==null)t+="\x1B[49m";else switch(e.backgroundColor){case"black":{t+="\x1B[40m";break}case"blue":{t+="\x1B[44m";break}case"cyan":{t+="\x1B[46m";break}case"green":{t+="\x1B[42m";break}case"magenta":{t+="\x1B[45m";break}case"red":{t+="\x1B[41m";break}case"white":{t+="\x1B[47m";break}case"yellow":{t+="\x1B[43m";break}default:if(Array.isArray(e.backgroundColor)){const{0:f,1:i,2:o}=e.backgroundColor;t+=`\x1B[48;2;${f};${i};${o}m`}else{const f=g(e.backgroundColor);if(f===null)t+="\x1B[49m";else{const{0:i,1:o,2:l}=f;t+=`\x1B[48;2;${i};${o};${l}m`}}}if(!h(e.color,r.color))if(e.color==null)t+="\x1B[39m";else switch(e.color){case"black":{t+="\x1B[30m";break}case"blue":{t+="\x1B[34m";break}case"cyan":{t+="\x1B[36m";break}case"green":{t+="\x1B[32m";break}case"magenta":{t+="\x1B[35m";break}case"red":{t+="\x1B[31m";break}case"white":{t+="\x1B[37m";break}case"yellow":{t+="\x1B[33m";break}default:if(Array.isArray(e.color)){const{0:f,1:i,2:o}=e.color;t+=`\x1B[38;2;${f};${i};${o}m`}else{const f=g(e.color);if(f===null)t+="\x1B[39m";else{const{0:i,1:o,2:l}=f;t+=`\x1B[38;2;${i};${o};${l}m`}}}if(e.fontWeight!==r.fontWeight&&(t+=e.fontWeight==="bold"?"\x1B[1m":"\x1B[22m"),e.fontStyle!==r.fontStyle&&(t+=e.fontStyle==="italic"?"\x1B[3m":"\x1B[23m"),!h(e.textDecorationColor,r.textDecorationColor))if(e.textDecorationColor==null)t+="\x1B[59m";else{const{0:f,1:i,2:o}=e.textDecorationColor;t+=`\x1B[58;2;${f};${i};${o}m`}return e.textDecorationLine.includes("line-through")!==r.textDecorationLine.includes("line-through")&&(t+=e.textDecorationLine.includes("line-through")?"\x1B[9m":"\x1B[29m"),e.textDecorationLine.includes("overline")!==r.textDecorationLine.includes("overline")&&(t+=e.textDecorationLine.includes("overline")?"\x1B[53m":"\x1B[55m"),e.textDecorationLine.includes("underline")!==r.textDecorationLine.includes("underline")&&(t+=e.textDecorationLine.includes("underline")?"\x1B[4m":"\x1B[24m"),t},"cssToAnsi");var S=Object.defineProperty,k=B((e,r)=>S(e,"name",{value:r,configurable:!0}),"y");const E=k(e=>{try{return JSON.stringify(e)}catch{return'"[Circular]"'}},"tryStringify"),w="%".codePointAt(0),O="s".codePointAt(0),I="d".codePointAt(0),W="f".codePointAt(0),T="i".codePointAt(0),_="O".codePointAt(0),z="o".codePointAt(0),J="j".codePointAt(0),G="c".codePointAt(0),H=k((e,r=[],t={})=>{if(typeof e!="string"&&typeof e!="object"||e===null)throw new TypeError(`fmt must be a string or object, got ${e===null?"null":typeof e}`);const f=t.stringify??E,i=1;if(typeof e=="object"){const a=r.length+i;if(a===1)return"{}";const s=Array.from({length:a});s[0]=f(e);for(let d=1;d<a;d++)s[d]=f(r[d-i]);return s.join(" ")}if(r.length===0)return e;let o="",l=1-i,n=-1,c=!1,u=null;for(let a=0;a<e.length;){if(e.codePointAt(a)===w&&a+1<e.length){n=n>-1?n:0;const s=e.codePointAt(a+1);if(s===void 0){++l;break}switch(s){case G:{if(globalThis.window===void 0){const d=F(r[l]);n<a&&(o+=e.slice(n,a)),o+=q(d,u),o!==""&&(c=!0,u=d)}n=a+2,a++;break}case I:case W:{if(l>=r.length||r[l]==null)break;n<a&&(o+=e.slice(n,a)),o+=Number(r[l]).toString(),n=a+2,a++;break}case T:{if(l>=r.length||r[l]==null)break;n<a&&(o+=e.slice(n,a)),o+=Math.floor(Number(r[l])).toString(),n=a+2,a++;break}case J:case _:case z:{if(l>=r.length||r[l]===void 0)break;n<a&&(o+=e.slice(n,a));const d=r[l],b=typeof d;if(b==="string"){o+=`'${d}'`,n=a+2;break}if(b==="function"){o+=d.name?`[Function: ${d.name}]`:"[Function: <anonymous>]",n=a+2;break}o+=f(d),n=a+2,a++;break}case w:{n<a&&(o+=e.slice(n,a)),o+="%",n=a+2,a++,l--;break}case O:{if(l>=r.length)break;n<a&&(o+=e.slice(n,a)),o+=typeof r[l]=="object"?f(r[l]):String(r[l]),n=a+2,a++;break}default:typeof t.formatters?.[s]=="function"&&(n<a&&(o+=e.slice(n,a)),o+=t.formatters[s](r[l]),n=a+2,a++)}++l}++a}return n===-1?e:(n<e.length&&(o+=e.slice(n)),c&&(o+="\x1B[0m"),o)},"format"),Q=k((e={})=>{const r={};return typeof e.formatters=="object"&&Object.entries(e.formatters).forEach(([t,f])=>{if(t.length===0)throw new Error(`Formatter %${t} has no characters`);if(t.length>1)throw new Error(`Formatter %${t} has more than one character`);if(typeof f!="function")throw new TypeError(`Formatter for %${t} is not a function`);const i=t.codePointAt(0);if(i===void 0)throw new Error(`${t}.codePointAt(0) failed to return a value, please report this issue`);r[i]=f}),(t,f=[],i={})=>H(t,f,{...i,formatters:r})},"build");export{Q as G,H as v};
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { LiteralUnion } from 'type-fest';
|
|
2
|
-
|
|
3
|
-
type ColorizeMethod = (value: string) => string;
|
|
4
|
-
type CodeFrameOptions = {
|
|
5
|
-
color?: {
|
|
6
|
-
gutter?: ColorizeMethod;
|
|
7
|
-
marker?: ColorizeMethod;
|
|
8
|
-
message?: ColorizeMethod;
|
|
9
|
-
};
|
|
10
|
-
linesAbove?: number;
|
|
11
|
-
linesBelow?: number;
|
|
12
|
-
message?: string;
|
|
13
|
-
prefix?: string;
|
|
14
|
-
showGutter?: boolean;
|
|
15
|
-
showLineNumbers?: boolean;
|
|
16
|
-
tabWidth?: number | false;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
type Options$1 = Omit<CodeFrameOptions, "message | prefix"> & {
|
|
20
|
-
color: CodeFrameOptions["color"] & {
|
|
21
|
-
fileLine: ColorizeMethod;
|
|
22
|
-
hint: ColorizeMethod;
|
|
23
|
-
method: ColorizeMethod;
|
|
24
|
-
title: ColorizeMethod;
|
|
25
|
-
};
|
|
26
|
-
cwd: string;
|
|
27
|
-
displayShortPath: boolean;
|
|
28
|
-
filterStacktrace: ((line: string) => boolean) | undefined;
|
|
29
|
-
framesMaxLimit: number;
|
|
30
|
-
hideErrorCauseCodeView: boolean;
|
|
31
|
-
hideErrorCodeView: boolean;
|
|
32
|
-
hideErrorErrorsCodeView: boolean;
|
|
33
|
-
hideErrorTitle: boolean;
|
|
34
|
-
hideMessage: boolean;
|
|
35
|
-
indentation: number | "\t";
|
|
36
|
-
prefix: string;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
interface Options {
|
|
40
|
-
breakLength: number;
|
|
41
|
-
customInspect: boolean;
|
|
42
|
-
depth: number;
|
|
43
|
-
indent: number | "\t" | undefined;
|
|
44
|
-
maxArrayLength: number;
|
|
45
|
-
numericSeparator: boolean;
|
|
46
|
-
quoteStyle: "double" | "single";
|
|
47
|
-
showHidden: boolean;
|
|
48
|
-
showProxy: boolean;
|
|
49
|
-
stylize: <S extends string>(value: S, styleType: LiteralUnion<"bigint" | "boolean" | "date" | "null" | "number" | "regexp" | "special" | "string" | "symbol" | "undefined", string>) => string;
|
|
50
|
-
truncate: number;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export type { Options$1 as O, Options as a };
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
type Replacer = (number | string)[] | null | undefined | ((key: string, value: unknown) => string | number | boolean | null | object)
|
|
2
|
-
|
|
3
|
-
interface StringifyOptions {
|
|
4
|
-
bigint?: boolean,
|
|
5
|
-
circularValue?: string | null | TypeErrorConstructor | ErrorConstructor,
|
|
6
|
-
deterministic?: boolean | ((a: string, b: string) => number),
|
|
7
|
-
maximumBreadth?: number,
|
|
8
|
-
maximumDepth?: number,
|
|
9
|
-
strict?: boolean,
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
declare function stringify(value: undefined | symbol | ((...args: unknown[]) => unknown), replacer?: Replacer, space?: string | number): undefined
|
|
13
|
-
declare function stringify(value: string | number | unknown[] | null | boolean | object, replacer?: Replacer, space?: string | number): string
|
|
14
|
-
declare function stringify(value: unknown, replacer?: ((key: string, value: unknown) => unknown) | (number | string)[] | null | undefined, space?: string | number): string | undefined
|
|
15
|
-
|
|
16
|
-
declare namespace stringify {
|
|
17
|
-
export function configure(options: StringifyOptions): typeof stringify
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export { stringify as s };
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var u=Object.defineProperty;var s=(t,e)=>u(t,"name",{value:e,configurable:!0});import{createRequire as f}from"node:module";const h=f(import.meta.url),i=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,l=s(t=>{if(typeof i<"u"&&i.versions&&i.versions.node){const[e,r]=i.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return i.getBuiltinModule(t)}return h(t)},"__cjs_getBuiltinModule"),{StringDecoder:p}=l("node:string_decoder");var d=Object.defineProperty,c=s((t,e)=>d(t,"name",{value:e,configurable:!0}),"t$1");const n="\x1B[2J",w="\x1B[2K",m=c((t=1)=>`${"\x1B["+t}A`,"cursorUp"),j=process.platform==="win32"?`${n}\x1B[0f`:`${n}\x1B[3J\x1B[H`,g="\x1B[?25l",v="\x1B[?25h",B=c(t=>{let e="";for(let r=0;r<t;r++)e+=w+(r<t-1?m():"");return t&&(e+="\x1B[G"),e},"eraseLines");var _=Object.defineProperty,x=s((t,e)=>_(t,"name",{value:e,configurable:!0}),"s");class a{static{s(this,"t")}static{x(this,"InteractiveStreamHook")}static DRAIN=!0;#s=new p;#e=[];#r;#t;constructor(e){this.#r=e.write,this.#t=e}active(){this.write(g),this.#t.write=(e,...r)=>{const o=r.at(-1);return this.#e.push(this.#s.write(typeof e=="string"?Buffer.from(e,typeof r[0]=="string"?r[0]:void 0):Buffer.from(e))),typeof o=="function"&&o(),a.DRAIN}}erase(e){e>0&&this.write(B(e+1))}inactive(e=!1){this.#e.length>0&&(e&&this.write(`
|
|
2
|
-
`),this.#e.forEach(r=>{this.write(r)}),this.#e=[]),this.renew()}renew(){this.#t.write=this.#r,this.write(v)}write(e){this.#r.apply(this.#t,[e])}}export{j as c,a as t};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
var re=Object.defineProperty;var y=(d,e)=>re(d,"name",{value:e,configurable:!0});import{L as ie,a as se,E as oe}from"./constants-DKfCaSUR.js";import{t as ne}from"./write-console-log-based-on-level-BP95fgQZ.js";import{s as le}from"./get-longest-label-B0NrI-o2.js";function ae(d){return d&&d.__esModule&&Object.prototype.hasOwnProperty.call(d,"default")?d.default:d}y(ae,"getDefaultExportFromCjs");var Q={exports:{}},te;function ue(){return te||(te=1,(function(d,e){var n=Object.defineProperty,i=y((r,s)=>n(r,"name",{value:s,configurable:!0}),"$");const{hasOwnProperty:a}=Object.prototype,b=z();b.configure=z,b.stringify=b,b.default=b,e.stringify=b,e.configure=z,d.exports=b;const C=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function L(r){return r.length<5e3&&!C.test(r)?`"${r}"`:JSON.stringify(r)}y(L,"strEscape"),i(L,"strEscape");function N(r,s){if(r.length>200||s)return r.sort(s);for(let g=1;g<r.length;g++){const E=r[g];let T=g;for(;T!==0&&r[T-1]>E;)r[T]=r[T-1],T--;r[T]=E}return r}y(N,"sort"),i(N,"sort");const P=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function _(r){return P.call(r)!==void 0&&r.length!==0}y(_,"isTypedArrayWithEntries"),i(_,"isTypedArrayWithEntries");function G(r,s,g){r.length<g&&(g=r.length);const E=s===","?"":" ";let T=`"0":${E}${r[0]}`;for(let D=1;D<g;D++)T+=`${s}"${D}":${E}${r[D]}`;return T}y(G,"stringifyTypedArray"),i(G,"stringifyTypedArray");function W(r){if(a.call(r,"circularValue")){const s=r.circularValue;if(typeof s=="string")return`"${s}"`;if(s==null)return s;if(s===Error||s===TypeError)return{toString(){throw new TypeError("Converting circular structure to JSON")}};throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined')}return'"[Circular]"'}y(W,"getCircularValueOption"),i(W,"getCircularValueOption");function K(r){let s;if(a.call(r,"deterministic")&&(s=r.deterministic,typeof s!="boolean"&&typeof s!="function"))throw new TypeError('The "deterministic" argument must be of type boolean or comparator function');return s===void 0?!0:s}y(K,"getDeterministicOption"),i(K,"getDeterministicOption");function X(r,s){let g;if(a.call(r,s)&&(g=r[s],typeof g!="boolean"))throw new TypeError(`The "${s}" argument must be of type boolean`);return g===void 0?!0:g}y(X,"getBooleanOption"),i(X,"getBooleanOption");function Y(r,s){let g;if(a.call(r,s)){if(g=r[s],typeof g!="number")throw new TypeError(`The "${s}" argument must be of type number`);if(!Number.isInteger(g))throw new TypeError(`The "${s}" argument must be an integer`);if(g<1)throw new RangeError(`The "${s}" argument must be >= 1`)}return g===void 0?1/0:g}y(Y,"getPositiveIntegerOption"),i(Y,"getPositiveIntegerOption");function q(r){return r===1?"1 item":`${r} items`}y(q,"getItemCount"),i(q,"getItemCount");function H(r){const s=new Set;for(const g of r)(typeof g=="string"||typeof g=="number")&&s.add(String(g));return s}y(H,"getUniqueReplacerSet"),i(H,"getUniqueReplacerSet");function Z(r){if(a.call(r,"strict")){const s=r.strict;if(typeof s!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(s)return g=>{let E=`Object can not safely be stringified. Received type ${typeof g}`;throw typeof g!="function"&&(E+=` (${g.toString()})`),new Error(E)}}}y(Z,"getStrictOption"),i(Z,"getStrictOption");function z(r){r={...r};const s=Z(r);s&&(r.bigint===void 0&&(r.bigint=!1),"circularValue"in r||(r.circularValue=Error));const g=W(r),E=X(r,"bigint"),T=K(r),D=typeof T=="function"?T:void 0,J=Y(r,"maximumDepth"),$=Y(r,"maximumBreadth");function V(O,t,o,f,u,h){let l=t[O];switch(typeof l=="object"&&l!==null&&typeof l.toJSON=="function"&&(l=l.toJSON(O)),l=f.call(t,O,l),typeof l){case"string":return L(l);case"object":{if(l===null)return"null";if(o.indexOf(l)!==-1)return g;let c="",v=",";const w=h;if(Array.isArray(l)){if(l.length===0)return"[]";if(J<o.length+1)return'"[Array]"';o.push(l),u!==""&&(h+=u,c+=`
|
|
2
|
-
${h}`,v=`,
|
|
3
|
-
${h}`);const j=Math.min(l.length,$);let A=0;for(;A<j-1;A++){const k=V(String(A),l,o,f,u,h);c+=k!==void 0?k:"null",c+=v}const R=V(String(A),l,o,f,u,h);if(c+=R!==void 0?R:"null",l.length-1>$){const k=l.length-$-1;c+=`${v}"... ${q(k)} not stringified"`}return u!==""&&(c+=`
|
|
4
|
-
${w}`),o.pop(),`[${c}]`}let m=Object.keys(l);const S=m.length;if(S===0)return"{}";if(J<o.length+1)return'"[Object]"';let p="",x="";u!==""&&(h+=u,v=`,
|
|
5
|
-
${h}`,p=" ");const M=Math.min(S,$);T&&!_(l)&&(m=N(m,D)),o.push(l);for(let j=0;j<M;j++){const A=m[j],R=V(A,l,o,f,u,h);R!==void 0&&(c+=`${x}${L(A)}:${p}${R}`,x=v)}if(S>$){const j=S-$;c+=`${x}"...":${p}"${q(j)} not stringified"`,x=v}return u!==""&&x.length>1&&(c=`
|
|
6
|
-
${h}${c}
|
|
7
|
-
${w}`),o.pop(),`{${c}}`}case"number":return isFinite(l)?String(l):s?s(l):"null";case"boolean":return l===!0?"true":"false";case"undefined":return;case"bigint":if(E)return String(l);default:return s?s(l):void 0}}y(V,"J"),i(V,"stringifyFnReplacer");function B(O,t,o,f,u,h){switch(typeof t=="object"&&t!==null&&typeof t.toJSON=="function"&&(t=t.toJSON(O)),typeof t){case"string":return L(t);case"object":{if(t===null)return"null";if(o.indexOf(t)!==-1)return g;const l=h;let c="",v=",";if(Array.isArray(t)){if(t.length===0)return"[]";if(J<o.length+1)return'"[Array]"';o.push(t),u!==""&&(h+=u,c+=`
|
|
8
|
-
${h}`,v=`,
|
|
9
|
-
${h}`);const S=Math.min(t.length,$);let p=0;for(;p<S-1;p++){const M=B(String(p),t[p],o,f,u,h);c+=M!==void 0?M:"null",c+=v}const x=B(String(p),t[p],o,f,u,h);if(c+=x!==void 0?x:"null",t.length-1>$){const M=t.length-$-1;c+=`${v}"... ${q(M)} not stringified"`}return u!==""&&(c+=`
|
|
10
|
-
${l}`),o.pop(),`[${c}]`}o.push(t);let w="";u!==""&&(h+=u,v=`,
|
|
11
|
-
${h}`,w=" ");let m="";for(const S of f){const p=B(S,t[S],o,f,u,h);p!==void 0&&(c+=`${m}${L(S)}:${w}${p}`,m=v)}return u!==""&&m.length>1&&(c=`
|
|
12
|
-
${h}${c}
|
|
13
|
-
${l}`),o.pop(),`{${c}}`}case"number":return isFinite(t)?String(t):s?s(t):"null";case"boolean":return t===!0?"true":"false";case"undefined":return;case"bigint":if(E)return String(t);default:return s?s(t):void 0}}y(B,"I"),i(B,"stringifyArrayReplacer");function I(O,t,o,f,u){switch(typeof t){case"string":return L(t);case"object":{if(t===null)return"null";if(typeof t.toJSON=="function"){if(t=t.toJSON(O),typeof t!="object")return I(O,t,o,f,u);if(t===null)return"null"}if(o.indexOf(t)!==-1)return g;const h=u;if(Array.isArray(t)){if(t.length===0)return"[]";if(J<o.length+1)return'"[Array]"';o.push(t),u+=f;let p=`
|
|
14
|
-
${u}`;const x=`,
|
|
15
|
-
${u}`,M=Math.min(t.length,$);let j=0;for(;j<M-1;j++){const R=I(String(j),t[j],o,f,u);p+=R!==void 0?R:"null",p+=x}const A=I(String(j),t[j],o,f,u);if(p+=A!==void 0?A:"null",t.length-1>$){const R=t.length-$-1;p+=`${x}"... ${q(R)} not stringified"`}return p+=`
|
|
16
|
-
${h}`,o.pop(),`[${p}]`}let l=Object.keys(t);const c=l.length;if(c===0)return"{}";if(J<o.length+1)return'"[Object]"';u+=f;const v=`,
|
|
17
|
-
${u}`;let w="",m="",S=Math.min(c,$);_(t)&&(w+=G(t,v,$),l=l.slice(t.length),S-=t.length,m=v),T&&(l=N(l,D)),o.push(t);for(let p=0;p<S;p++){const x=l[p],M=I(x,t[x],o,f,u);M!==void 0&&(w+=`${m}${L(x)}: ${M}`,m=v)}if(c>$){const p=c-$;w+=`${m}"...": "${q(p)} not stringified"`,m=v}return m!==""&&(w=`
|
|
18
|
-
${u}${w}
|
|
19
|
-
${h}`),o.pop(),`{${w}}`}case"number":return isFinite(t)?String(t):s?s(t):"null";case"boolean":return t===!0?"true":"false";case"undefined":return;case"bigint":if(E)return String(t);default:return s?s(t):void 0}}y(I,"V"),i(I,"stringifyIndent");function F(O,t,o){switch(typeof t){case"string":return L(t);case"object":{if(t===null)return"null";if(typeof t.toJSON=="function"){if(t=t.toJSON(O),typeof t!="object")return F(O,t,o);if(t===null)return"null"}if(o.indexOf(t)!==-1)return g;let f="";const u=t.length!==void 0;if(u&&Array.isArray(t)){if(t.length===0)return"[]";if(J<o.length+1)return'"[Array]"';o.push(t);const w=Math.min(t.length,$);let m=0;for(;m<w-1;m++){const p=F(String(m),t[m],o);f+=p!==void 0?p:"null",f+=","}const S=F(String(m),t[m],o);if(f+=S!==void 0?S:"null",t.length-1>$){const p=t.length-$-1;f+=`,"... ${q(p)} not stringified"`}return o.pop(),`[${f}]`}let h=Object.keys(t);const l=h.length;if(l===0)return"{}";if(J<o.length+1)return'"[Object]"';let c="",v=Math.min(l,$);u&&_(t)&&(f+=G(t,",",$),h=h.slice(t.length),v-=t.length,c=","),T&&(h=N(h,D)),o.push(t);for(let w=0;w<v;w++){const m=h[w],S=F(m,t[m],o);S!==void 0&&(f+=`${c}${L(m)}:${S}`,c=",")}if(l>$){const w=l-$;f+=`${c}"...":"${q(w)} not stringified"`}return o.pop(),`{${f}}`}case"number":return isFinite(t)?String(t):s?s(t):"null";case"boolean":return t===!0?"true":"false";case"undefined":return;case"bigint":if(E)return String(t);default:return s?s(t):void 0}}y(F,"N"),i(F,"stringifySimple");function ee(O,t,o){if(arguments.length>1){let f="";if(typeof o=="number"?f=" ".repeat(Math.min(o,10)):typeof o=="string"&&(f=o.slice(0,10)),t!=null){if(typeof t=="function")return V("",{"":O},[],t,f,"");if(Array.isArray(t))return B("",O,[],H(t),f,"")}if(f.length!==0)return I("",O,[],f,"")}return F("",O,[])}return y(ee,"M"),i(ee,"stringify"),ee}y(z,"configure"),i(z,"configure")})(Q,Q.exports)),Q.exports}y(ue,"requireSafeStableStringify");var ce=ue();const ge=ae(ce),fe=ge.configure;var he=Object.defineProperty,pe=y((d,e)=>he(d,"name",{value:e,configurable:!0}),"t");class de{static{y(this,"i")}static{pe(this,"RawReporter")}log(e){const{context:n=[],message:i,type:a}=e;ne(a.level)(i,...n)}}var ye=Object.defineProperty,me=y((d,e)=>ye(d,"name",{value:e,configurable:!0}),"a");const be=me(d=>d===void 0?[]:Array.isArray(d)?d:[d],"arrayify");var $e=Object.defineProperty,ve=y((d,e)=>$e(d,"name",{value:e,configurable:!0}),"g");const we=ve((d,e)=>{const n={...d};return Object.keys(e).forEach(i=>{n[i]={...n[i],...e[i]}}),n},"mergeTypes");var Se=Object.defineProperty,U=y((d,e)=>Se(d,"name",{value:e,configurable:!0}),"c");const Oe=U(d=>{let e=!1;return function(...n){if(!e){e=!0;try{const i=d.apply(this,n);return e=!1,i}catch(i){throw e=!1,i}}}},"preventLoop");class Te{static{y(this,"PailBrowserImpl")}static{U(this,"PailBrowserImpl")}timersMap;countMap;seqTimers;lastLog;logLevels;disabled;paused;messageQueue;scopeName;types;longestLabel;processors;generalLogLevel;reporters;throttle;throttleMin;stringify;groups;startTimerMessage;endTimerMessage;rawReporter;constructor(e){this.throttle=e.throttle??1e3,this.throttleMin=e.throttleMin??5,this.stringify=fe({strict:!0}),this.startTimerMessage=e.messages?.timerStart??"Initialized timer...",this.endTimerMessage=e.messages?.timerEnd??"Timer run for:",this.types=we(ie,e.types??{}),this.longestLabel=le(this.types),this.logLevels={...se,...e.logLevels},this.generalLogLevel=this.#t(e.logLevel),this.reporters=new Set,this.processors=new Set,this.disabled=e.disabled??!1,this.paused=!1,this.messageQueue=[],this.scopeName=be(e.scope).filter(Boolean),this.timersMap=new Map,this.countMap=new Map,this.groups=[],this.seqTimers=new Set,this.lastLog={},this.logger=Oe(this.logger).bind(this);for(const n in this.types)this[n]=this.logger.bind(this,n,!1);Array.isArray(e.reporters)&&this.registerReporters(e.reporters),this.rawReporter=this.extendReporter(e.rawReporter??new de),Array.isArray(e.processors)&&this.#r(e.processors)}wrapConsole(){for(const e in this.types)console[`__${e}`]||(console[`__${e}`]=console[e]),console[e]=this[e]}restoreConsole(){for(const e in this.types)console[`__${e}`]&&(console[e]=console[`__${e}`],delete console[`__${e}`])}wrapException(){process.on("uncaughtException",e=>{this.error(e)}),process.on("unhandledRejection",e=>{this.error(e)})}disable(){this.disabled=!0}enable(){this.disabled=!1}isEnabled(){return!this.disabled}pause(){this.paused=!0}resume(){this.paused=!1;const e=this.messageQueue.splice(0);for(const{messageObject:n,raw:i,type:a}of e)this.logger(a,i,...n)}scope(...e){if(e.length===0)throw new Error("No scope name was defined.");return this.scopeName=e.flat(),this}unscope(){this.scopeName=[]}time(e="default"){this.seqTimers.has(e)?this.logger("warn",!1,{message:`Timer '${e}' already exists`,prefix:e}):(this.seqTimers.add(e),this.timersMap.set(e,Date.now()),this.logger("start",!1,{message:this.startTimerMessage,prefix:e}))}timeLog(e,...n){if(!e&&this.seqTimers.size>0&&(e=[...this.seqTimers].pop()),e&&this.timersMap.has(e)){const i=Date.now()-this.timersMap.get(e);this.logger("info",!1,{context:n,message:i<1e3?`${i} ms`:`${(i/1e3).toFixed(2)} s`,prefix:e})}else this.logger("warn",!1,{context:n,message:"Timer not found",prefix:e})}timeEnd(e){if(!e&&this.seqTimers.size>0&&(e=[...this.seqTimers].pop()),e&&this.timersMap.has(e)){const n=Date.now()-this.timersMap.get(e);this.timersMap.delete(e),this.logger("stop",!1,{message:`${this.endTimerMessage} ${n<1e3?`${n} ms`:`${(n/1e3).toFixed(2)} s`}`,prefix:e})}else this.logger("warn",!1,{message:"Timer not found",prefix:e})}group(e="console.group"){globalThis.window===void 0?this.groups.push(e):console.group(e)}groupEnd(){globalThis.window===void 0?this.groups.pop():console.groupEnd()}count(e="default"){const n=this.countMap.get(e)??0;this.countMap.set(e,n+1),this.logger("log",!1,{message:`${e}: ${n+1}`,prefix:e})}countReset(e="default"){this.countMap.has(e)?this.countMap.delete(e):this.logger("warn",!1,{message:`Count for ${e} does not exist`,prefix:e})}clear(){console.clear()}raw(e,...n){this.disabled||this.logger("log",!0,{context:n,message:e})}extendReporter(e){return typeof e.setLoggerTypes=="function"&&e.setLoggerTypes(this.types),typeof e.setStringify=="function"&&e.setStringify(this.stringify),e}registerReporters(e){for(const n of e)this.reporters.add(this.extendReporter(n))}#e(e,n){if(n)this.rawReporter.log(Object.freeze(e));else for(const i of this.reporters)i.log(Object.freeze(e))}#r(e){for(const n of e)typeof n.setStringify=="function"&&n.setStringify(this.stringify),this.processors.add(n)}#t(e){return e&&this.logLevels[e]?e:"debug"}#i(e,n,...i){const a={badge:void 0,context:void 0,error:void 0,label:void 0,message:oe,prefix:void 0,repeated:void 0,scope:void 0,suffix:void 0};if(a.type={level:n.logLevel,name:e},a.groups=this.groups,a.scope=this.scopeName,a.date=new Date,i.length>0&&i[0]instanceof Error)a.error=i[0],i.length>1&&(a.context=i.slice(1));else if(i.length>0&&typeof i[0]=="object"&&i[0]!==null&&"message"in i[0]){const{context:b,message:C,prefix:L,suffix:N}=i[0];if(b&&(a.context=b),L&&(a.prefix=L),N&&(a.suffix=N),a.message=C,i.length>1){const P=i.slice(1);a.context?a.context=Array.isArray(a.context)?[...a.context,...P]:[a.context,...P]:a.context=P}}else i.length>1?(a.message=i[0],a.context=i.slice(1)):i.length===1?a.message=i[0]:a.message=void 0;return n.logLevel==="trace"&&(a.traceError=new Error("Trace")),n.badge&&(a.badge=n.badge),n.label&&(a.label=n.label),a}logger(e,n,...i){if(this.disabled)return;if(this.paused){this.messageQueue.push({messageObject:i,raw:n,type:e});return}const a=this.#t(this.types[e].logLevel);if(this.logLevels[a]>=this.logLevels[this.generalLogLevel]){let b=this.#i(e,this.types[e],...i);const C=U((N=!1)=>{const P=(this.lastLog.count||0)-this.throttleMin;if(this.lastLog.object&&P>0){const _={...this.lastLog.object};P>1&&(_.repeated=P),this.#e(_,n),this.lastLog.count=1}if(N){for(const _ of this.processors)b={..._.process(b)};this.lastLog.object=b,this.#e(b,n)}},"resolveLog");clearTimeout(this.lastLog.timeout);const L=this.lastLog.time&&b.date?new Date(b.date).getTime()-this.lastLog.time.getTime():0;if(this.lastLog.time=new Date(b.date),L<this.throttle)try{if(this.lastLog.object&&JSON.stringify([b.label,b.scope,b.type,b.message,b.prefix,b.suffix,b.context])===JSON.stringify([this.lastLog.object.label,this.lastLog.object.scope,this.lastLog.object.type,this.lastLog.object.message,this.lastLog.object.prefix,this.lastLog.object.suffix,this.lastLog.object.context])&&(this.lastLog.count=(this.lastLog.count||0)+1,this.lastLog.count>this.throttleMin)){this.lastLog.timeout=setTimeout(C,this.throttle);return}}catch{}C(!0)}}}const Me=Te;export{Me as P,Te as a};
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { s as stringify } from './index.d-oxZvg_y7.js';
|
|
2
|
-
import { LiteralUnion } from 'type-fest';
|
|
3
|
-
import { C as ConstructorOptions, M as Meta, a as DefaultLogTypes, d as LoggerTypesConfig, P as Processor, E as ExtendedRfc5424LogLevels, R as Reporter, b as LoggerFunction } from './types-DVzG8TWL.js';
|
|
4
|
-
|
|
5
|
-
declare class PailBrowserImpl<T extends string = string, L extends string = string> {
|
|
6
|
-
#private;
|
|
7
|
-
protected timersMap: Map<string, number>;
|
|
8
|
-
protected countMap: Map<string, number>;
|
|
9
|
-
protected seqTimers: Set<string>;
|
|
10
|
-
protected readonly lastLog: {
|
|
11
|
-
count?: number;
|
|
12
|
-
object?: Meta<L>;
|
|
13
|
-
time?: Date;
|
|
14
|
-
timeout?: ReturnType<typeof setTimeout>;
|
|
15
|
-
};
|
|
16
|
-
protected readonly logLevels: Record<string, number>;
|
|
17
|
-
protected disabled: boolean;
|
|
18
|
-
protected paused: boolean;
|
|
19
|
-
protected messageQueue: {
|
|
20
|
-
messageObject: any[];
|
|
21
|
-
raw: boolean;
|
|
22
|
-
type: LiteralUnion<DefaultLogTypes, T>;
|
|
23
|
-
}[];
|
|
24
|
-
protected scopeName: string[];
|
|
25
|
-
protected readonly types: LoggerTypesConfig<LiteralUnion<DefaultLogTypes, T>, L>;
|
|
26
|
-
protected readonly longestLabel: string;
|
|
27
|
-
protected readonly processors: Set<Processor<L>>;
|
|
28
|
-
protected readonly generalLogLevel: LiteralUnion<ExtendedRfc5424LogLevels, L>;
|
|
29
|
-
protected reporters: Set<Reporter<L>>;
|
|
30
|
-
protected readonly throttle: number;
|
|
31
|
-
protected readonly throttleMin: number;
|
|
32
|
-
protected readonly stringify: typeof stringify;
|
|
33
|
-
protected groups: string[];
|
|
34
|
-
protected readonly startTimerMessage: string;
|
|
35
|
-
protected readonly endTimerMessage: string;
|
|
36
|
-
protected rawReporter: Reporter<L>;
|
|
37
|
-
constructor(options: ConstructorOptions<T, L>);
|
|
38
|
-
wrapConsole(): void;
|
|
39
|
-
restoreConsole(): void;
|
|
40
|
-
wrapException(): void;
|
|
41
|
-
disable(): void;
|
|
42
|
-
enable(): void;
|
|
43
|
-
isEnabled(): boolean;
|
|
44
|
-
pause(): void;
|
|
45
|
-
resume(): void;
|
|
46
|
-
scope<N extends string = T>(...name: string[]): PailBrowserType<N, L>;
|
|
47
|
-
unscope(): void;
|
|
48
|
-
time(label?: string): void;
|
|
49
|
-
timeLog(label?: string, ...data: unknown[]): void;
|
|
50
|
-
timeEnd(label?: string): void;
|
|
51
|
-
group(label?: string): void;
|
|
52
|
-
groupEnd(): void;
|
|
53
|
-
count(label?: string): void;
|
|
54
|
-
countReset(label?: string): void;
|
|
55
|
-
clear(): void;
|
|
56
|
-
raw(message: string, ...arguments_: unknown[]): void;
|
|
57
|
-
protected extendReporter(reporter: Reporter<L>): Reporter<L>;
|
|
58
|
-
protected registerReporters(reporters: Reporter<L>[]): void;
|
|
59
|
-
protected logger(type: LiteralUnion<DefaultLogTypes, T>, raw: boolean, ...messageObject: any[]): void;
|
|
60
|
-
}
|
|
61
|
-
type PailBrowserType<T extends string = string, L extends string = string> = (new <TC extends string = string, LC extends string = string>(options?: ConstructorOptions<TC, LC>) => PailBrowserType<TC, LC>) & PailBrowserImpl<T, L> & Record<DefaultLogTypes, LoggerFunction> & Record<T, LoggerFunction>;
|
|
62
|
-
|
|
63
|
-
export { PailBrowserImpl as a };
|
|
64
|
-
export type { PailBrowserType as P };
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import { AnsiColors } from '@visulima/colorize';
|
|
2
|
-
import { LiteralUnion, Primitive } from 'type-fest';
|
|
3
|
-
import { InteractiveManager } from '../interactive/index.js';
|
|
4
|
-
|
|
5
|
-
declare global {
|
|
6
|
-
namespace VisulimaPail {
|
|
7
|
-
interface CustomMeta<L> {
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
interface Meta<L> extends VisulimaPail.CustomMeta<L> {
|
|
12
|
-
badge: string | undefined;
|
|
13
|
-
context: any[] | undefined;
|
|
14
|
-
date: Date | string;
|
|
15
|
-
error: Error | undefined;
|
|
16
|
-
groups: string[];
|
|
17
|
-
label: string | undefined;
|
|
18
|
-
message: Primitive | ReadonlyArray<unknown> | Record<PropertyKey, unknown>;
|
|
19
|
-
prefix: string | undefined;
|
|
20
|
-
repeated?: number | undefined;
|
|
21
|
-
scope: string[] | undefined;
|
|
22
|
-
suffix: string | undefined;
|
|
23
|
-
traceError: Error | undefined;
|
|
24
|
-
type: {
|
|
25
|
-
level: ExtendedRfc5424LogLevels | L;
|
|
26
|
-
name: string;
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
type ExtendedRfc5424LogLevels = "alert" | "critical" | "debug" | "emergency" | "error" | "informational" | "notice" | "trace" | "warning";
|
|
30
|
-
type DefaultLogTypes = "alert" | "await" | "complete" | "critical" | "debug" | "emergency" | "error" | "info" | "log" | "notice" | "pending" | "start" | "stop" | "success" | "trace" | "wait" | "warn" | "warning" | "watch";
|
|
31
|
-
interface LoggerFunction {
|
|
32
|
-
(message: Message): void;
|
|
33
|
-
(...message: any[]): void;
|
|
34
|
-
}
|
|
35
|
-
interface LoggerConfiguration<L extends string> {
|
|
36
|
-
badge?: string;
|
|
37
|
-
color?: AnsiColors | undefined;
|
|
38
|
-
label: string;
|
|
39
|
-
logLevel: LiteralUnion<ExtendedRfc5424LogLevels, L>;
|
|
40
|
-
}
|
|
41
|
-
type LoggerTypesConfig<T extends string, L extends string> = Record<T, Partial<LoggerConfiguration<L>>>;
|
|
42
|
-
type DefaultLoggerTypes<L extends string = string> = Record<DefaultLogTypes, LoggerConfiguration<L>>;
|
|
43
|
-
type ReadonlyMeta<L extends string> = Readonly<Meta<L>>;
|
|
44
|
-
interface Reporter<L extends string> {
|
|
45
|
-
log: (meta: ReadonlyMeta<L>) => void;
|
|
46
|
-
}
|
|
47
|
-
interface StreamAwareReporter<L extends string> extends Reporter<L> {
|
|
48
|
-
setStderr: (stderr: NodeJS.WriteStream) => void;
|
|
49
|
-
setStdout: (stdout: NodeJS.WriteStream) => void;
|
|
50
|
-
}
|
|
51
|
-
interface LoggerTypesAwareReporter<T extends string, L extends string> extends Reporter<L> {
|
|
52
|
-
setLoggerTypes: (types: LoggerTypesConfig<T, L> & Partial<LoggerTypesConfig<DefaultLogTypes, L>>) => void;
|
|
53
|
-
}
|
|
54
|
-
interface StringifyAwareReporter<L extends string> extends Reporter<L> {
|
|
55
|
-
setStringify: (stringify: typeof JSON.stringify) => void;
|
|
56
|
-
}
|
|
57
|
-
interface InteractiveStreamReporter<L extends string> extends StreamAwareReporter<L> {
|
|
58
|
-
setInteractiveManager: (manager?: InteractiveManager) => void;
|
|
59
|
-
setIsInteractive: (interactive: boolean) => void;
|
|
60
|
-
}
|
|
61
|
-
interface Processor<L extends string> {
|
|
62
|
-
process: (meta: Meta<L>) => Meta<L>;
|
|
63
|
-
}
|
|
64
|
-
interface StringifyAwareProcessor<L extends string> extends Processor<L> {
|
|
65
|
-
setStringify: (stringify: typeof JSON.stringify) => void;
|
|
66
|
-
}
|
|
67
|
-
interface ConstructorOptions<T extends string, L extends string> {
|
|
68
|
-
disabled?: boolean;
|
|
69
|
-
logLevel?: LiteralUnion<ExtendedRfc5424LogLevels, L>;
|
|
70
|
-
logLevels?: Partial<Record<ExtendedRfc5424LogLevels, number>> & Record<L, number>;
|
|
71
|
-
messages?: {
|
|
72
|
-
timerEnd?: string;
|
|
73
|
-
timerStart?: string;
|
|
74
|
-
};
|
|
75
|
-
processors?: Processor<L>[];
|
|
76
|
-
rawReporter?: Reporter<L>;
|
|
77
|
-
reporters?: Reporter<L>[];
|
|
78
|
-
scope?: string[] | string;
|
|
79
|
-
throttle?: number;
|
|
80
|
-
throttleMin?: number;
|
|
81
|
-
types?: LoggerTypesConfig<T, L> & Partial<LoggerTypesConfig<DefaultLogTypes, L>>;
|
|
82
|
-
}
|
|
83
|
-
interface ServerConstructorOptions<T extends string, L extends string> extends ConstructorOptions<T, L> {
|
|
84
|
-
interactive?: boolean;
|
|
85
|
-
stderr: NodeJS.WriteStream;
|
|
86
|
-
stdout: NodeJS.WriteStream;
|
|
87
|
-
}
|
|
88
|
-
type Message = {
|
|
89
|
-
context?: any[] | undefined;
|
|
90
|
-
message: any;
|
|
91
|
-
prefix?: string;
|
|
92
|
-
suffix?: string;
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
export type { ConstructorOptions as C, DefaultLoggerTypes as D, ExtendedRfc5424LogLevels as E, InteractiveStreamReporter as I, LoggerConfiguration as L, Meta as M, Processor as P, Reporter as R, StreamAwareReporter as S, DefaultLogTypes as a, LoggerFunction as b, LoggerTypesAwareReporter as c, LoggerTypesConfig as d, StringifyAwareReporter as e, ReadonlyMeta as f, ServerConstructorOptions as g, StringifyAwareProcessor as h };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var n=Object.defineProperty;var r=(o,e)=>n(o,"name",{value:e,configurable:!0});var c=Object.defineProperty,l=r((o,e)=>c(o,"name",{value:e,configurable:!0}),"o");const s=l(o=>o==="error"?console.__error??console.error:o==="warn"?console.__warn??console.warn:o==="trace"?console.__trace??console.trace:console.__log??console.log,"writeConsoleLogBasedOnLevel");export{s as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var t=Object.defineProperty;var a=(r,e)=>t(r,"name",{value:e,configurable:!0});var i=Object.defineProperty,n=a((r,e)=>i(r,"name",{value:e,configurable:!0}),"r");const l=n((r,e)=>(e.__write??e.write).call(e,r),"writeStream");export{l as n};
|