pickier 0.1.38 → 0.1.39
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/dist/bin/cli.js +3 -44355
- package/dist/chunk-5wzkpgv6.js +62 -0
- package/dist/chunk-5zxqxpyk.js +2 -0
- package/dist/chunk-88xjkex3.js +156 -0
- package/dist/chunk-96ebhnpj.js +2 -0
- package/dist/chunk-ayzr3qv1.js +218 -0
- package/dist/chunk-cbqydxbp.js +33 -0
- package/dist/chunk-h6ac3d60.js +3 -0
- package/dist/chunk-kbvc5qze.js +2 -0
- package/dist/chunk-nwytx79z.js +2 -0
- package/dist/chunk-wdphw37x.js +3 -0
- package/dist/src/index.js +1 -40104
- package/package.json +1 -1
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{I as P}from"./chunk-5wzkpgv6.js";import{L as F0}from"./chunk-h6ac3d60.js";function qZ($){let Y=$.length,V=Array.from({length:Y},(X,J)=>$[J]),Z=0;while(Z<Y){let X=$[Z];if(X==="#"&&(Z===0||/\s/.test($[Z-1]))){while(Z<Y)V[Z]=" ",Z++;break}if(X==="$"&&$[Z+1]==="'"){Z+=2;while(Z<Y){if($[Z]==="\\"&&Z+1<Y){V[Z]=" ",V[Z+1]=" ",Z+=2;continue}if($[Z]==="'"){Z++;break}V[Z]=" ",Z++}continue}if(X==="$"&&$[Z+1]==='"'){Z++,Z=C($,Z,V);continue}if(X==="$"&&$[Z+1]==="{"){Z+=2;let J=1;while(Z<Y&&J>0){let H=$[Z];if(H==="\\"&&Z+1<Y){V[Z]=" ",V[Z+1]=" ",Z+=2;continue}if(H==="'"){Z++;while(Z<Y&&$[Z]!=="'")V[Z]=" ",Z++;if(Z<Y)Z++;continue}if(H==='"'){Z=C($,Z,V);continue}if(H==="{"){J++,Z++;continue}if(H==="}"){J--,Z++;continue}V[Z]=" ",Z++}continue}if(X==="$"&&$[Z+1]==="("&&$[Z+2]==="("){Z+=3;let J=2;while(Z<Y&&J>0){let H=$[Z];if(H==="("){J++,Z++;continue}if(H===")"){J--,Z++;continue}V[Z]=" ",Z++}continue}if(X==="$"&&$[Z+1]==="("){Z+=2;let J=1;while(Z<Y&&J>0){let H=$[Z];if(H==="\\"&&Z+1<Y){V[Z]=" ",V[Z+1]=" ",Z+=2;continue}if(H==="'"){Z++;while(Z<Y&&$[Z]!=="'")V[Z]=" ",Z++;if(Z<Y)Z++;continue}if(H==='"'){Z=C($,Z,V);continue}if(H==="("){J++,Z++;continue}if(H===")"){J--,Z++;continue}V[Z]=" ",Z++}continue}if(X==="'"){Z++;while(Z<Y&&$[Z]!=="'")V[Z]=" ",Z++;if(Z<Y)Z++;continue}if(X==='"'){Z=C($,Z,V);continue}if(X==="`"){Z++;while(Z<Y&&$[Z]!=="`"){if($[Z]==="\\"&&Z+1<Y){V[Z]=" ",V[Z+1]=" ",Z+=2;continue}V[Z]=" ",Z++}if(Z<Y)Z++;continue}Z++}return V.join("")}function C($,Y,V){let Z=$.length,X=Y+1;while(X<Z){let J=$[X];if(J==="\\"&&X+1<Z){V[X]=" ",V[X+1]=" ",X+=2;continue}if(J==='"')return X+1;if(J==="$"&&$[X+1]==="("&&$[X+2]==="("){X+=3;let H=2;while(X<Z&&H>0){let U=$[X];if(U==="("){H++,X++;continue}if(U===")"){H--,X++;continue}V[X]=" ",X++}continue}if(J==="$"&&$[X+1]==="("){X+=2;let H=1;while(X<Z&&H>0){let U=$[X];if(U==="\\"&&X+1<Z){V[X]=" ",V[X+1]=" ",X+=2;continue}if(U==="'"){X++;while(X<Z&&$[X]!=="'")V[X]=" ",X++;if(X<Z)X++;continue}if(U==='"'){X=C($,X,V);continue}if(U==="("){H++,X++;continue}if(U===")"){H--,X++;continue}V[X]=" ",X++}continue}if(J==="$"&&$[X+1]==="{"){X+=2;let H=1;while(X<Z&&H>0){let U=$[X];if(U==="{"){H++,X++;continue}if(U==="}"){H--,X++;continue}V[X]=" ",X++}continue}V[X]=" ",X++}return X}function o($){let V=qZ($).match(/<<-?/);if(!V||V.index===void 0)return null;let X=$.slice(V.index+V[0].length).match(/^\s*(['"]?)(\w+)\1/);if(!X)return null;return X[2]}var QZ=new Set([".ts",".js"]),KZ=new Set([".json",".jsonc"]),FZ=new Set([".yaml",".yml"]),zZ=new Set([".sh",".bash",".zsh",".ksh",".dash"]),BZ=/^#!\s*(?:\/usr\/bin\/env\s+)?(?:ba|z|k|da)?sh\b/;var GZ=/^[}\])]/,DZ=/[{[(]\s*$/,yZ=/\s*\/\/.*$/,MZ=/^(?:if|else\s+if|for|while)\s*\(/,AZ=/^(?:\.[\w$[]|\?[\s.:]|:\s|&&|\|\|)/;function OZ($){let Y=MZ.exec($);if(!Y)return/^(?:else|do)\s*$/.test($);let V=0,Z=null;for(let X=Y[0].length-1;X<$.length;X++){let J=$[X];if(Z){if(J==="\\"){X++;continue}if(J===Z)Z=null;continue}if(J==="'"||J==='"'||J==="`"){Z=J;continue}if(J==="(")V++;else if(J===")"){if(V--,V===0)return $.slice(X+1).trim().length===0}}return!1}var NZ=/^\s*for\s*\(/,jZ=new RegExp("^\\s*;\\s*$"),wZ=new RegExp(";{2,}\\s*$"),IZ=/([\w)])\{/g,RZ=/\{(return|if|for|while|switch|const|let|var|function)\b/g,LZ=/,(\S)/g,PZ=/(?<![=!<>+\-*/%&|^?])=(?![=><])/g,vZ=/(\w)\+(\w)/g,_Z=/(\w)-(\w)/g,TZ=/(\w)\*(\w)/g,CZ=/(\w)\/(\w)/g,EZ=new RegExp("(?<=\\S);([^\\s;])","g"),xZ=/([\w)\]])<(\d)/g,kZ=/([\w)\]])>(\d)/g,a=/\s{2,}/g,l=/^\s*$/,SZ=/^\s*\/\//,r=/^\s*\/\*/,bZ=/^\s*import\b/,s=/\bfrom\s*['"][^'"]+['"]|^\s*import\s+['"][^'"]+['"]/,fZ=/package\.json$/i,hZ=/[jt]sconfig(?:\..+)?\.json$/i,b=/[ \t]+$/,gZ=/^\n+/;function x($){let Y=$.lastIndexOf(".");return Y>=0?$.slice(Y):""}function f($){return QZ.has(x($))}function mZ($){return KZ.has(x($))}function uZ($){return FZ.has(x($))}function cZ($){return zZ.has(x($))}function pZ($,Y){return cZ($)||BZ.test(Y)}function dZ($,Y){let V=$.split(`
|
|
3
|
+
`),Z=V.length,X=Array(Z),J=Y.format.indent,H=Y.format.indentStyle==="tabs",U=0,Q=!1,F="",z=!1,G=0;for(let W=0;W<Z;W++){let D=V[W];if(D.length===0||/^\s*$/.test(D)){X[W]="";continue}if(Q){if(X[W]=D,D.trim()===F)Q=!1,F="";continue}let M=o(D);if(M)Q=!0,F=M;let A=0;while(A<D.length&&(D.charCodeAt(A)===32||D.charCodeAt(A)===9))A++;let B=D.slice(A).trimEnd();if(B.startsWith("#")&&W>0){let S=H?"\t".repeat(U):" ".repeat(U*J);X[W]=S+B;continue}if(/^case\b/.test(B)&&/\bin\s*$/.test(B))G++,z=!0;if(/^esac\b/.test(B)){if(G=Math.max(0,G-1),G===0)z=!1}let N=z&&/\)\s*$/.test(B)&&!/\$\(/.test(B)&&!/^\s*\(/.test(B)&&!B.startsWith("#"),j=/^;[;&]\s*$/.test(B);if(/^(?:fi|done|esac|elif|else)\b/.test(B)||/^\}/.test(B))U=Math.max(0,U-1);if(j)U=Math.max(0,U-1);let L=H?"\t".repeat(U):" ".repeat(U*J);if(X[W]=L+B,/^then\b/.test(B)||/^do\b/.test(B)||/^else\b/.test(B))U++;else if(/^if\b/.test(B)&&/\bthen\s*$/.test(B))U++;else if(/^elif\b/.test(B)&&/\bthen\s*$/.test(B))U++;else if(/^(?:while|for|until)\b/.test(B)&&/\bdo\s*$/.test(B))U++;else if(/^case\b/.test(B)&&/\bin\s*$/.test(B))U++;else if(N)U++;else if(/\{\s*$/.test(B)&&!B.startsWith("#"))U++}return X.join(`
|
|
4
|
+
`)}function oZ($,Y){try{let V=Bun.YAML.parse($),Z=Y.format.indentStyle==="tabs"?"\t":Y.format.indent;return Bun.YAML.stringify(V,null,Z).split(`
|
|
5
|
+
`).map((J)=>J.replace(/[ \t]+$/,"")).join(`
|
|
6
|
+
`)}catch{return $}}function aZ($){return" ".repeat(Math.max(0,$))}function lZ($,Y){if((Y.format.indentStyle||"spaces")==="tabs")return"\t".repeat(Math.max(0,$));return aZ(Math.max(0,$*Y.format.indent))}function rZ($){return`'${$.slice(1,-1).replace(/\\"/g,'"')}'`}function sZ($){return`"${$.slice(1,-1).replace(/\\'/g,"'")}"`}function nZ($,Y){for(let V=0;V<$.length;V++){if($[V]==="\\"){V++;continue}if($[V]===Y)return!0}return!1}function tZ($,Y,V){if(!f(V))return $;let Z=$.split(`
|
|
7
|
+
`);for(let X=0;X<Z.length;X++)Z[X]=e(Z[X],Y);return Z.join(`
|
|
8
|
+
`)}function e($,Y){let V=Y==="single";if(V?!$.includes('"'):!$.includes("'"))return $;let Z=[],X=0,J=0,H=0,U=0;while(X<$.length){let Q=$[X];if(H===0){if(Q==="/"){let F=$[X+1];if(F==="/")break;if(F==="*"){let z=$.indexOf("*/",X+2);X=z===-1?$.length:z+2;continue}if(VZ($,X)){let z=XZ($,X);if(z!==-1){X=z;continue}}X++;continue}if(Q==='"'){H=2,U=X,X++;continue}if(Q==="'"){H=1,U=X,X++;continue}if(Q==="`"){H=3,X++;continue}X++}else if(H===3){if(Q==="\\"){X+=2;continue}if(Q==="`")H=0;X++}else{if(Q==="\\"){X+=2;continue}if(Q===(H===1?"'":'"')){let z=$.slice(U+1,X);if((H===2&&V||H===1&&!V)&&!nZ(z,V?"'":'"')){if(U>J)Z.push($.slice(J,U));if(H===2)Z.push(rZ(`"${z}"`));else Z.push(sZ(`'${z}'`));J=X+1}H=0,X++;continue}X++}}if(Z.length===0)return $;if(J<$.length)Z.push($.slice(J));return Z.join("")}var iZ=new Set(["{",",","=","+","-","*","/",";","<",">"]);function eZ($){if($.length<4)return $;let Y=0;while(Y<$.length&&($[Y]===" "||$[Y]==="\t"))Y++;if(Y<$.length){let H=$[Y];if(H==="/"&&($[Y+1]==="/"||$[Y+1]==="*"))return $;if(H==="*")return $}let V=!1;for(let H=Y;H<$.length;H++)if(iZ.has($[H])){V=!0;break}if(!V)return $;let{text:Z,strings:X}=X0($),J=Z;if(J=J.replace(IZ,"$1 {"),J=J.replace(RZ,"{ $1"),J=J.replace(LZ,", $1"),J=J.replace(PZ," = "),J=J.replace(vZ,"$1 + $2"),J=J.replace(_Z,"$1 - $2"),J=J.replace(TZ,"$1 * $2"),J=J.replace(CZ,"$1 / $2"),J=J.replace(EZ,"; $1"),J=J.replace(xZ,"$1 < $2"),J=J.replace(kZ,"$1 > $2"),Y>0){let H=J.slice(Y);J=J.slice(0,Y)+H.replace(a," ")}else J=J.replace(a," ");return X.length>0?Y0(J,X):J}function k($){let Y=$[$.length-1];return Y!==void 0&&Y.t==="tmpl"}function ZZ($,Y,V){Y++;while(Y<$.length){let Z=$[Y];if(Z==="\\"){Y+=2;continue}if(Z===V)return Y+1;Y++}return Y}function h($,Y){for(let Z of Y)if(Z.t==="tmpl")Z.start=-1;let V=0;while(V<$.length){let Z=Y[Y.length-1],X=$[V];if(Z===void 0||Z.t==="interp"){if(X==="`"){Y.push({t:"tmpl",start:V}),V++;continue}if(X==="'"||X==='"'){V=ZZ($,V,X);continue}if(X==="/"&&$[V+1]==="/")break;if(Z!==void 0){if(X==="{"){Z.braces++,V++;continue}if(X==="}"){if(Z.braces===0)Y.pop();else Z.braces--;V++;continue}}V++}else{if(X==="\\"){V+=2;continue}if(X==="`"){Y.pop(),V++;continue}if(X==="$"&&$[V+1]==="{"){Y.push({t:"interp",braces:0}),V+=2;continue}V++}}if(k(Y)){for(let Z of Y)if(Z.t==="tmpl"&&Z.start>=0)return Z.start}return-1}function n($,Y){let V=Y,Z=null,X=0;while(X<$.length){let J=$[X];if(V){if(J==="*"&&$[X+1]==="/"){V=!1,X+=2;continue}X++;continue}if(Z){if(J==="\\"){X+=2;continue}if(J===Z)Z=null;X++;continue}if(J==="'"||J==='"'||J==="`"){Z=J,X++;continue}if(J==="/"){if($[X+1]==="/")break;if($[X+1]==="*"){V=!0,X+=2;continue}}X++}return V}function Z0($,Y){let V=$.split(`
|
|
9
|
+
`),Z=V.length,X=Array(Z),J=Y.format.quotes,H=Y.format.semi===!0,U=0,Q=0,F=!1,z=[];for(let G=0;G<Z;G++){let W=V[G];if(F){F=n(W,!0),X[G]=W;continue}let D=k(z),M=-1;if(z.length>0||W.indexOf("`")!==-1)M=h(W,z);if(D){X[G]=W;continue}if(M<0&&z.length===0)F=n(W,!1);let A="",B=!1;if(M>=0){A=W.slice(M);let L=W.slice(0,M);if(L.length===0){X[G]=A;continue}B=b.test(L),W=L}if(W.length===0){X[G]="";continue}W=e(W,J);let N=0;while(N<W.length&&(W.charCodeAt(N)===32||W.charCodeAt(N)===9))N++;let j=W.slice(N).trimEnd();if(GZ.test(j))U=Math.max(0,U-1);let _=AZ.test(j)?1:0;if(W=lZ(U+Q+_,Y)+j,DZ.test(j))U+=1,Q=0;else if(!j.startsWith("//")&&!j.startsWith("*")&&!j.startsWith("/*")){let L=j.replace(yZ,"");Q=OZ(L)?Q+1:0}if(W=eZ(W),H){if(!NZ.test(W))if(jZ.test(W))W="";else W=W.replace(wZ,";")}if(M>=0){if(B&&!b.test(W))W+=" ";W+=A}X[G]=W}return X.join(`
|
|
10
|
+
`)}function $0($,Y){let V=[],Z=0,X=[];for(let J of $){let H=k(X);if(X.length>0||J.indexOf("`")!==-1)h(J,X);if(H){V.push(J),Z=0;continue}if(J===""){if(Z++,Z<=Y)V.push("")}else Z=0,V.push(J)}return V}function _0($,Y,V){if($.length===0)return"";let X=($.includes("\r")?$.replace(/\r\n/g,`
|
|
11
|
+
`):$).split(`
|
|
12
|
+
`),J;if(Y.format.trimTrailingWhitespace){J=[];let F=0,z=Math.max(0,Y.format.maxConsecutiveBlankLines),G=[];for(let W of X){let D=k(G),M=!1;if(G.length>0||W.indexOf("`")!==-1)M=h(W,G)>=0;if(D||M){J.push(W),F=0;continue}let A=W[W.length-1],B=A===" "||A==="\t"?W.replace(b,""):W;if(B===""){if(F++,F<=z)J.push("")}else F=0,J.push(B)}}else J=$0(X,Math.max(0,Y.format.maxConsecutiveBlankLines));let H=J.join(`
|
|
13
|
+
`);if(H=H.replace(gZ,""),f(V))H=H0(H);if(uZ(V)){let F=oZ(H,Y);if(F!==H)H=F}if(mZ(V)){let F=q0(H,V);if(F!=null)H=F}if(pZ(V,H))H=dZ(H,Y);else if(f(V))H=Z0(H,Y);else H=tZ(H,Y.format.quotes,V);if(Y.format.finalNewline==="none")return H.replace(/\n+$/g,"");let U=/[^\n]\n$/.test(H)||H===`
|
|
14
|
+
`,Q=/\n\n$/.test(H);if(Y.format.finalNewline==="two"){if(Q)return H;if(U)return`${H}
|
|
15
|
+
`;return`${H}
|
|
16
|
+
|
|
17
|
+
`}if(Q)return H.replace(/\n\n$/,`
|
|
18
|
+
`);if(U)return H;return`${H}
|
|
19
|
+
`}function t($,Y,V,Z){for(let X=Y+1;X<$.length;X++){let J=$[X];if(J==="\\"){X++;continue}if(J===V)return!0;if(J===Z)return!1}return!0}function T0($,Y){if(/^\s*\/\/\/\s*<reference/.test($))return[];let V=[],Z=null,X=!1;for(let J=0;J<$.length;J++){let H=$[J];if(X){X=!1;continue}if(H==="\\"){X=!0;continue}if(!Z){if(H==="/"&&$[J+1]==="/")break;if(H==="'"){if(Y==="double"&&t($,J,"'",'"'))V.push(J);Z="single";continue}else if(H==='"'){if(Y==="single"&&t($,J,'"',"'"))V.push(J);Z="double";continue}else if(H==="`"){Z="template";continue}}else if(Z==="single"&&H==="'"||Z==="double"&&H==='"'||Z==="template"&&H==="`"){Z=null;continue}}return V}function C0($,Y,V="spaces",Z){if(V==="tabs")return/[^\t]/.test($);if(/\t/.test($))return!0;let X=$.length;if(Z&&X%Y===1){let J=Z.trimStart();if(J.startsWith("* ")||J.startsWith("*/")||J==="*")return!1}return X%Y!==0}function $Z($,Y){let V=Y+1;while(V<$.length){let Z=$[V];if(Z==="\\"){V+=2;continue}if(Z==="`")return V+1;if(Z==="$"&&$[V+1]==="{"){V+=2;let X=1;while(V<$.length&&X>0){let J=$[V];if(J==="\\"){V+=2;continue}if(J==="`"){V=$Z($,V);continue}if(J==="'"||J==='"'){V=ZZ($,V,J);continue}if(J==="{")X++;else if(J==="}")X--;V++}continue}V++}return V}var V0=new Set(["return","typeof","instanceof","in","of","new","delete","void","do","else","case","yield","await"]);function VZ($,Y){let V=Y-1;while(V>=0&&($[V]===" "||$[V]==="\t"))V--;if(V<0)return!0;let Z=$[V];if("(,=:[!&|?;{}<>+-*%^~".includes(Z))return!0;if(/[\w$]/.test(Z)){let X=V;while(X>=0&&/[\w$]/.test($[X]))X--;return V0.has($.slice(X+1,V+1))}return!1}function XZ($,Y){let V=Y+1,Z=!1,X=-1;while(V<$.length){let J=$[V];if(J==="\\"){V+=2;continue}if(J==="["&&!Z)Z=!0,X=V;else if(J==="]"&&Z){let H=$[X+1]==="^"?X+2:X+1;if(V!==H)Z=!1}else if(J==="/"&&!Z){V++;while(V<$.length&&/[a-z]/i.test($[V]))V++;return V}V++}return-1}function X0($){if(!$.includes("'")&&!$.includes('"')&&!$.includes("`")&&!$.includes("/"))return{text:$,strings:[]};let Y=[],V=[],Z=0,X=0;while(Z<$.length){let J=$[Z];if(J==="/"){let H=$[Z+1];if(H==="/"){if(Z>X)V.push($.slice(X,Z));Y.push($.slice(Z)),V.push(`@@S${Y.length-1}@@`),X=$.length;break}if(H==="*"){let U=$.indexOf("*/",Z+2),Q=U===-1?$.length:U+2;if(Z>X)V.push($.slice(X,Z));Y.push($.slice(Z,Q)),V.push(`@@S${Y.length-1}@@`),Z=Q,X=Z;continue}if(VZ($,Z)){let U=XZ($,Z);if(U!==-1){if(Z>X)V.push($.slice(X,Z));Y.push($.slice(Z,U)),V.push(`@@S${Y.length-1}@@`),Z=U,X=Z;continue}}Z++;continue}if(J==="'"||J==='"'||J==="`"){if(Z>X)V.push($.slice(X,Z));let H=Z;if(J==="`")Z=$Z($,Z);else{let U=J;Z++;while(Z<$.length){if($[Z]==="\\"){Z+=2;continue}if($[Z]===U){Z++;break}Z++}}Y.push($.slice(H,Z)),V.push(`@@S${Y.length-1}@@`),X=Z;continue}Z++}if(X<$.length)V.push($.slice(X));return{text:V.join(""),strings:Y}}function Y0($,Y){if(Y.length===0)return $;return $.replace(/@@S(\d+)@@/g,(V,Z)=>Y[Number(Z)]??"")}function J0($){let Y=new Set,V=/[$A-Z_][\w$]*/gi,Z=V.exec($);while(Z!==null)Y.add(Z[0]),Z=V.exec($);return Y}function H0($){let Y=$[0];if(Y!=="i"&&Y!==" "&&Y!=="\t"&&Y!=="/"&&Y!==`
|
|
20
|
+
`)return $;let V=$.split(`
|
|
21
|
+
`),Z=[],X=[],J=[],H=0,U=0,Q=-1,F=!1;while(H<V.length){let q=V[H];if(l.test(q)){H++;continue}if(SZ.test(q)||r.test(q)){let y=H;if(r.test(q)){while(H<V.length&&!V[H].includes("*/"))H++;H++}else H++;if(!F){for(let I=y;I<H&&I<V.length;I++)X.push(V[I]);U=H}else if(Q<0)Q=y;continue}if(!bZ.test(q))break;let K=q.trim(),w=H+1;while(!s.test(K)&&w<V.length&&w-H<50)K+=` ${V[w].trim()}`,w++;if(!s.test(K))return $;let O=W0(K);if(!O)return $;if(Q>=0){for(let y=Q;y<H;y++)if(!l.test(V[y]))J.push(V[y]);Q=-1}Z.push(O),H=w,U=H,F=!0}if(Z.length===0)return $;let z=Q>=0?Q:U,G=V.slice(z).join(`
|
|
22
|
+
`),W=J0(G),D=(q)=>W.has(q);for(let q of Z){if(q.kind!=="value")continue;q.named=q.named.filter((K)=>{if(K.alias)return!0;return D(K.name)})}let M=Z.filter((q)=>{if(q.kind==="side-effect")return!0;if(q.kind==="type")return q.namedTypes.length>0;return Boolean(q.defaultName||q.namespaceName||q.named.length>0)}),A=new Map;for(let q of M){let K=A.get(q.source)||{};if(q.kind==="side-effect")K.side=K.side||[],K.side.push(q);else if(q.kind==="type"){if(!K.type)K.type={kind:"type",source:q.source,named:[],namedTypes:[],original:""};K.type.namedTypes=(K.type.namedTypes||[]).concat(q.namedTypes)}else{if(!K.value)K.value={kind:"value",source:q.source,named:[],namedTypes:[],original:""};if(q.defaultName)K.value.defaultName=q.defaultName;if(q.namespaceName)K.value.namespaceName=q.namespaceName;if(K.value.named=(K.value.named||[]).concat(q.named),q.namedTypes.length>0){if(!K.type)K.type={kind:"type",source:q.source,named:[],namedTypes:[],original:""};K.type.namedTypes=K.type.namedTypes.concat(q.namedTypes)}}A.set(q.source,K)}let B=[];for(let[q,K]of A){if(K.side)B.push(...K.side);if(K.value){let w=(O)=>{if(!O.alias)return O;return/^[A-Z]$/i.test(O.name)&&/^[A-Z]$/i.test(O.alias)?{name:O.alias,alias:O.name}:O};K.value.named=K.value.named.map(w),K.value.named.sort((O,y)=>O.name.localeCompare(y.name)),B.push(K.value)}if(K.type&&K.type.namedTypes.length>0){let w=new Set,O=(y)=>{if(!y.alias)return y;return/^[A-Z]$/i.test(y.name)&&/^[A-Z]$/i.test(y.alias)?{name:y.alias,alias:y.name}:y};K.type.namedTypes=K.type.namedTypes.map(O).filter((y)=>{let I=`${y.name}|${y.alias||""}`;if(w.has(I))return!1;return w.add(I),!0}),K.type.namedTypes.sort((y,I)=>y.name.localeCompare(I.name)),B.push(K.type)}}let N=(q)=>q.startsWith(".")?2:q.startsWith("node:")?0:1,j=(q)=>{if(q.kind!=="value")return 99;if(q.defaultName)return 0;if(q.namespaceName)return 1;return 2};B.sort((q,K)=>{if(q.kind!==K.kind){if(q.kind==="type")return-1;if(K.kind==="type")return 1;if(q.kind==="side-effect")return-1;if(K.kind==="side-effect")return 1}if(q.kind==="type"&&K.kind==="type"){let w=N(q.source),O=N(K.source);if(w!==O)return w-O;return q.source.localeCompare(K.source)}if(q.kind==="value"&&K.kind==="value"){let w=N(q.source),O=N(K.source);if(w!==O)return w-O;let y=j(q),I=j(K);if(y!==I)return y-I;return q.source.localeCompare(K.source)}return q.source.localeCompare(K.source)});let _=X.length>0?`${X.join(`
|
|
23
|
+
`)}
|
|
24
|
+
`:"";if(B.length===0){let q=G.replace(/^\n+/,""),K=[...J];if(_||K.length>0)return`${_}${K.length>0?`${K.join(`
|
|
25
|
+
`)}
|
|
26
|
+
`:""}${q}`;return q}let L=B.map(U0).join(`
|
|
27
|
+
`),S=J.length>0?`
|
|
28
|
+
${J.join(`
|
|
29
|
+
`)}`:"",d=G.replace(/^\n+/,""),WZ=d.length>0?`
|
|
30
|
+
|
|
31
|
+
`:`
|
|
32
|
+
`;return`${_}${L}${S}${WZ}${d}`}function U0($){if($.kind==="side-effect")return`import '${$.source}'`;if($.kind==="type")return`import type { ${$.namedTypes.map((X)=>X.alias?`${X.name} as ${X.alias}`:X.name).join(", ")} } from '${$.source}'`;let Y=[];if($.defaultName)Y.push($.defaultName);if($.namespaceName)Y.push(`* as ${$.namespaceName}`);if($.named.length>0){let Z=$.named.map((X)=>X.alias?`${X.name} as ${X.alias}`:X.name).join(", ");Y.push(`{ ${Z} }`)}return`import ${Y.join(", ")} from '${$.source}'`}function W0($){let Y=$.match(/^\s*import\s+['"]([^'"]+)['"]/);if(Y)return{kind:"side-effect",source:Y[1],named:[],namedTypes:[],original:$};if(Y=$.match(/^\s*import\s+type\s+\{([^}]*)\}\s+from\s+['"]([^'"]+)['"]/),Y){let W=Y[1],D=Y[2],M=W.split(",").map((A)=>A.trim()).filter(Boolean).map((A)=>{let B=A.match(/^(\w+)(?:\s+as\s+(\w+))?$/);return{name:B?.[1]||A,alias:B?.[2]}});return{kind:"type",source:D,named:[],namedTypes:M,original:$}}let V=$.match(/^\s*import\s+/),Z=new RegExp(`\\sfrom\\s+['"]([^'"]+)['"]\\s*;?$`),X=$.match(Z);if(!V||!X)return;let J=X[1],H=$.slice(V[0].length,X.index).trim(),U,Q,F=[],z=[],G=H.match(/\{([^}]*)\}/);if(G){let D=G[1].split(",").map((M)=>M.trim()).filter(Boolean);for(let M of D){let A=/^type\s+/.test(M),N=M.replace(/^type\s+/,"").match(/^(\w+)(?:\s+as\s+(\w+))?$/);if(!N)continue;let j={name:N[1],alias:N[2]};if(A)z.push(j);else F.push(j)}H=H.replace(/\{[\s\S]*?\}/,"").trim()}if(H.length>0){let W=H.split(",").map((D)=>D.trim()).filter(Boolean);for(let D of W)if(D.startsWith("* as "))Q=D.slice(5).trim();else if(/^\w+$/.test(D))U=D}return{kind:"value",source:J,defaultName:U,namespaceName:Q,named:F,namedTypes:z,original:$}}function q0($,Y){if(fZ.test(Y))return Q0($);if(hZ.test(Y))return K0($);return null}function YZ($){try{return JSON.parse($)}catch{return null}}function E($,Y,V=[]){let Z={};for(let J of Y)if(Object.prototype.hasOwnProperty.call($,J))Z[J]=$[J];for(let J of V){let H=Object.keys($).filter((U)=>J.test(U)&&!(U in Z)).sort();for(let U of H)Z[U]=$[U]}let X=Object.keys($).filter((J)=>!(J in Z)).sort();for(let J of X)Z[J]=$[J];return Z}function i($){let Y={};for(let V of Object.keys($).sort())Y[V]=$[V];return Y}function Q0($){let Y=YZ($);if(!Y||typeof Y!=="object")return $;let Z=E(Y,["publisher","name","displayName","type","version","private","packageManager","description","author","contributors","license","funding","homepage","repository","bugs","keywords","categories","sideEffects","imports","exports","main","module","unpkg","jsdelivr","types","typesVersions","bin","icon","files","engines","activationEvents","contributes","scripts","peerDependencies","peerDependenciesMeta","dependencies","optionalDependencies","devDependencies","pnpm","overrides","resolutions","husky","simple-git-hooks","lint-staged","eslintConfig"]);if(Array.isArray(Z.files)){if(Z.files.every((H)=>typeof H==="string"))Z.files=[...Z.files].sort()}for(let J of Object.keys(Z))if(/^(?:dev|peer|optional|bundled)?[Dd]ependencies(?:Meta)?$/.test(J)||/^(?:resolutions|overrides|pnpm\.overrides)$/.test(J)){if(Z[J]&&typeof Z[J]==="object")Z[J]=i(Z[J])}if(Z.pnpm&&typeof Z.pnpm==="object"&&Z.pnpm.overrides&&typeof Z.pnpm.overrides==="object")Z.pnpm.overrides=i(Z.pnpm.overrides);if(Z.exports&&typeof Z.exports==="object"){let J=Z.exports,H=["types","import","require","default"];if(!Array.isArray(J)){let U={};for(let Q of Object.keys(J)){let F=J[Q];if(F&&typeof F==="object"&&!Array.isArray(F))U[Q]=E(F,H);else U[Q]=F}Z.exports=U}}let X=["pre-commit","prepare-commit-msg","commit-msg","post-commit","pre-rebase","post-rewrite","post-checkout","post-merge","pre-push","pre-auto-gc"];for(let J of["gitHooks","husky","simple-git-hooks"])if(Z[J]&&typeof Z[J]==="object")Z[J]=E(Z[J],X);return JSON.stringify(Z,null,2)}function K0($){let Y=YZ($);if(!Y||typeof Y!=="object")return $;let Z=E(Y,["extends","compilerOptions","references","files","include","exclude"]);if(Z.compilerOptions&&typeof Z.compilerOptions==="object"){let X=["incremental","composite","tsBuildInfoFile","disableSourceOfProjectReferenceRedirect","disableSolutionSearching","disableReferencedProjectLoad","target","jsx","jsxFactory","jsxFragmentFactory","jsxImportSource","lib","moduleDetection","noLib","reactNamespace","useDefineForClassFields","emitDecoratorMetadata","experimentalDecorators","libReplacement","baseUrl","rootDir","rootDirs","customConditions","module","moduleResolution","moduleSuffixes","noResolve","paths","resolveJsonModule","resolvePackageJsonExports","resolvePackageJsonImports","typeRoots","types","allowArbitraryExtensions","allowImportingTsExtensions","allowUmdGlobalAccess","allowJs","checkJs","maxNodeModuleJsDepth","strict","strictBindCallApply","strictFunctionTypes","strictNullChecks","strictPropertyInitialization","allowUnreachableCode","allowUnusedLabels","alwaysStrict","exactOptionalPropertyTypes","noFallthroughCasesInSwitch","noImplicitAny","noImplicitOverride","noImplicitReturns","noImplicitThis","noPropertyAccessFromIndexSignature","noUncheckedIndexedAccess","noUnusedLocals","noUnusedParameters","useUnknownInCatchVariables","declaration","declarationDir","declarationMap","downlevelIteration","emitBOM","emitDeclarationOnly","importHelpers","importsNotUsedAsValues","inlineSourceMap","inlineSources","mapRoot","newLine","noEmit","noEmitHelpers","noEmitOnError","outDir","outFile","preserveConstEnums","preserveValueImports","removeComments","sourceMap","sourceRoot","stripInternal","allowSyntheticDefaultImports","esModuleInterop","forceConsistentCasingInFileNames","isolatedDeclarations","isolatedModules","preserveSymlinks","verbatimModuleSyntax","erasableSyntaxOnly","skipDefaultLibCheck","skipLibCheck"];Z.compilerOptions=E(Z.compilerOptions,X)}return JSON.stringify(Z,null,2)}import{readdirSync as z0,readFileSync as B0,statSync as HZ}from"fs";import{extname as G0,isAbsolute as m,join as u,resolve as D0}from"path";import R from"process";var f0=5;function y0($){let Y="",V=0;while(V<$.length){let Z=$[V];if(Z==="*")if($[V+1]==="*"){if(Y+=".*",V+=2,$[V]==="/")V++}else Y+="[^/]*",V++;else if(Z==="?")Y+="[^/]",V++;else if(Z==="["){let X=$.indexOf("]",V);if(X===-1)Y+="\\[",V++;else Y+=$.slice(V,X+1),V=X+1}else if(".+^${}()|\\".includes(Z))Y+=`\\${Z}`,V++;else Y+=Z,V++}return new RegExp(`^${Y}$`)}function*UZ($,Y,V){let Z;try{Z=z0($)}catch{return}for(let X of Z){if(!V&&X.startsWith("."))continue;let J=u($,X);if(Y(J))continue;let H;try{H=HZ(J)}catch{continue}if(H.isDirectory())yield*UZ(J,Y,V);else yield J}}function*JZ($,Y,V,Z){yield*UZ($,p(Y,Z),V)}async function h0($,Y={}){let V=Y.cwd??R.cwd(),Z=Y.ignore??[],X=Y.dot??!1,J=Y.absolute??!0,H=p(Z,V);if(typeof globalThis.Bun?.Glob<"u"){let Q=globalThis.Bun.Glob,F=[];for(let z of $){let G=new Q(z);for await(let W of G.scan({cwd:V,dot:X,onlyFiles:Y.onlyFiles??!0,followSymlinks:!1})){let D=m(W)?W:u(V,W),M=D.startsWith(`${V}/`)?D.slice(V.length+1):D;if(H(D))continue;F.push(J?D:M)}}return F}let U=[];for(let Q of $){if(!/[*?[{]/.test(Q)){let z=m(Q)?Q:u(V,Q);try{if(!HZ(z).isDirectory()){let W=z.startsWith(`${V}/`)?z.slice(V.length+1):z;if(!H(z))U.push(J?z:W)}else for(let W of JZ(z,Z,X,V))U.push(J?W:W.startsWith(`${V}/`)?W.slice(V.length+1):W)}catch{}continue}let F=y0(Q);for(let z of JZ(V,Z,X,V)){let G=z.startsWith(`${V}/`)?z.slice(V.length+1):z;if(F.test(G)||F.test(G.replace(/\\/g,"/")))U.push(J?z:G)}}return U}function g0($){let Y=0,V=[],Z=()=>{if(V.length>0&&Y<$)Y++,V.shift()()};return(X)=>{return new Promise((J,H)=>{let U=()=>{X().then((Q)=>{Y--,J(Q),Z()},(Q)=>{Y--,H(Q),Z()})};if(Y<$)Y++,U();else V.push(U)})}}var M0={get TRACE(){return R.env.PICKIER_TRACE==="1"},get TIMEOUT_MS(){return Number(R.env.PICKIER_TIMEOUT_MS||"8000")},get RULE_TIMEOUT_MS(){return Number(R.env.PICKIER_RULE_TIMEOUT_MS||"5000")},get CONCURRENCY(){return Number(R.env.PICKIER_CONCURRENCY)||8},get DIAGNOSTICS(){return R.env.PICKIER_DIAGNOSTICS==="1"},get FAIL_ON_WARNINGS(){return R.env.PICKIER_FAIL_ON_WARNINGS==="1"},get NO_AUTO_CONFIG(){return R.env.PICKIER_NO_AUTO_CONFIG==="1"}},A0=["**/node_modules/**","**/dist/**","**/build/**","**/.git/**","**/.next/**","**/.nuxt/**","**/.output/**","**/.vercel/**","**/.netlify/**","**/.cache/**","**/.turbo/**","**/.vscode/**","**/.idea/**","**/.zed/**","**/.cursor/**","**/.claude/**","**/.github/**","**/coverage/**","**/.nyc_output/**","**/.tmp/**","**/.temp/**","**/vendor/**","**/pantry/**","**/target/**","**/zig-cache/**","**/zig-out/**","**/.zig-cache/**","**/__pycache__/**","**/.pytest_cache/**","**/venv/**","**/.venv/**","**/out/**","**/.DS_Store","**/Thumbs.db"];function m0($,Y){let V=$[Y];if(V===void 0){let J=Y.indexOf("/");if(J>0){let H=Y.slice(0,J),U=Y.slice(J+1),Q=H==="general"?"pickier":H==="pickier"?"general":null;if(Q)V=$[`${Q}/${U}`];if(V===void 0)V=$[U]}}let Z,X;if(typeof V==="string"){if(V==="error")Z="error";else if(V==="warn"||V==="warning")Z="warning"}else if(Array.isArray(V)&&typeof V[0]==="string"){let J=V[0];if(J==="error")Z="error";else if(J==="warn"||J==="warning")Z="warning";X=V[1]}return{enabled:!!Z,severity:Z,options:X}}function T($,Y){return`\x1B[${$}m${Y}\x1B[0m`}function O0($){return T("32",$)}function N0($){return T("31",$)}function j0($){return T("33",$)}function w0($){return T("34",$)}function I0($){return T("90",$)}function R0($){return T("1",$)}var u0={green:O0,red:N0,yellow:j0,blue:w0,gray:I0,bold:R0};function v($,Y){let V=Y.ignores?[...new Set([...$.ignores||[],...Y.ignores])]:$.ignores,Z={...$.pluginRules||{},...Y.pluginRules||{}};if((Y.tailwind??$.tailwind)?.enabled&&!Object.prototype.hasOwnProperty.call(Z,"pickier/sort-tailwind-classes"))Z["pickier/sort-tailwind-classes"]="warn";return{...$,...Y,verbose:Y.verbose??$.verbose,ignores:V,lint:{...$.lint,...Y.lint||{}},format:{...$.format,...Y.format||{}},rules:{...$.rules,...Y.rules||{}},pluginRules:Z}}var g=null;async function c0($){if(!$){if(M0.NO_AUTO_CONFIG){if(!g)g=v(P,{});return g}try{let{getConfig:Z}=await import("./chunk-nwytx79z.js"),X=await Z();return v(P,X)}catch{}return v(P,{})}let Y=m($)?$:D0(R.cwd(),$);if(G0(Y).toLowerCase()===".json")try{let Z=B0(Y,"utf8");return v(P,JSON.parse(Z))}catch{return console.warn(`[pickier:warn] Config file not found: ${Y}. Using default config values.`),v(P,{})}try{let Z=await import(Y);return v(P,Z.default||Z)}catch{return console.warn(`[pickier:warn] Config file not found: ${Y}. Using default config values.`),v(P,{})}}function p0($){return $.map((Y)=>{if(/[*?[\]{}()!]/.test(Y))return Y;if(/\.[A-Z0-9]+$/i.test(Y))return Y;return`${Y.replace(/\/$/,"")}/**/*`})}function d0($,Y){let V=$.lastIndexOf(".");if(V<0)return!1;let Z=$.slice(V);return Y.has(Z)}function c($){return $.replace(/\\/g,"/").replace(/\/+/g,"/")}function L0($){let Y=[];for(let V of $){let Z=c(V.trim());if(!Z)continue;let X=Z.match(/\*\*\/\*\.(.+)$/);if(X){Y.push({raw:Z,kind:"extension",value:X[1]});continue}let J=Z.match(/\*\*\/(.+?)\/\*\*$/);if(J){Y.push({raw:Z,kind:"segment",value:J[1]});continue}let H=Z.match(/\*\*\/(.+)$/);if(H)Y.push({raw:Z,kind:"suffix",value:H[1].replace(/\/$/,"")})}return Y}function p($,Y=R.cwd()){if($.length===0)return()=>!1;let V=L0($);if(V.length===0)return()=>!1;let Z=new Set(A0);return(X)=>{let J=c(X),H=c(Y).replace(/\/$/,""),U=J!==H&&!J.startsWith(`${H}/`),Q=U?J:J.slice(H.length);for(let F of V){if(U&&!Z.has(F.raw))continue;if(F.kind==="extension"){if(Q.endsWith(`.${F.value}`))return!0;continue}if(F.kind==="segment"||F.kind==="suffix"){let z=F.value;if(Q.includes(`/${z}/`)||Q.endsWith(`/${z}`))return!0}}return!1}}function o0($,Y){return p(Y)($)}
|
|
33
|
+
export{qZ as i,o as j,_0 as k,T0 as l,C0 as m,H0 as n,f0 as o,h0 as p,g0 as q,M0 as r,A0 as s,m0 as t,T as u,O0 as v,N0 as w,j0 as x,w0 as y,I0 as z,R0 as A,u0 as B,v as C,c0 as D,p0 as E,d0 as F,p as G,o0 as H};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import"./chunk-h6ac3d60.js";var e="pickier",u="module",t="0.1.39",r="Format, lint and more in a fraction of seconds.",s="Chris Breuer <chris@stacksjs.org>",l="MIT",p="https://github.com/pickier/pickier#readme",b={type:"git",url:"git+https://github.com/pickier/pickier.git"},m={url:"https://github.com/pickier/pickier/issues"},c=["pickier","linter","formatter","bun","fast"],o={".":{types:"./dist/index.d.ts",import:"./dist/src/index.js"},"./*":{import:"./dist/*"}},a="./dist/src/index.js",x="./dist/index.d.ts",d={pickier:"./dist/bin/cli.js"},w=["README.md","dist"],k={build:"bun --bun build.ts","build:bin":"bun --bun build.ts && bun run compile",compile:"bun build ./bin/cli.ts --compile --minify --outfile bin/pickier","compile:all":"bun run compile:linux-x64 && bun run compile:linux-arm64 && bun run compile:linux-x64-musl && bun run compile:linux-arm64-musl && bun run compile:windows-x64 && bun run compile:windows-arm64 && bun run compile:darwin-x64 && bun run compile:darwin-arm64","compile:linux-x64":"bun build ./bin/cli.ts --compile --minify --target=bun-linux-x64 --outfile bin/pickier-linux-x64","compile:linux-arm64":"bun build ./bin/cli.ts --compile --minify --target=bun-linux-arm64 --outfile bin/pickier-linux-arm64","compile:linux-x64-musl":"bun build ./bin/cli.ts --compile --minify --target=bun-linux-x64-musl --outfile bin/pickier-linux-x64-musl","compile:linux-arm64-musl":"bun build ./bin/cli.ts --compile --minify --target=bun-linux-arm64-musl --outfile bin/pickier-linux-arm64-musl","compile:windows-x64":"bun build ./bin/cli.ts --compile --minify --target=bun-windows-x64 --outfile bin/pickier-windows-x64.exe","compile:windows-arm64":"bun build ./bin/cli.ts --compile --minify --target=bun-windows-arm64 --outfile bin/pickier-windows-arm64.exe","compile:darwin-x64":"bun build ./bin/cli.ts --compile --minify --target=bun-darwin-x64 --outfile bin/pickier-darwin-x64","compile:darwin-arm64":"bun build ./bin/cli.ts --compile --minify --target=bun-darwin-arm64 --outfile bin/pickier-darwin-arm64",zip:"bun run zip:all","zip:all":"bun run zip:linux-x64 && bun run zip:linux-arm64 && bun run zip:linux-x64-musl && bun run zip:linux-arm64-musl && bun run zip:windows-x64 && bun run zip:windows-arm64 && bun run zip:darwin-x64 && bun run zip:darwin-arm64","zip:linux-x64":"zip -j bin/pickier-linux-x64.zip bin/pickier-linux-x64","zip:linux-arm64":"zip -j bin/pickier-linux-arm64.zip bin/pickier-linux-arm64","zip:linux-x64-musl":"zip -j bin/pickier-linux-x64-musl.zip bin/pickier-linux-x64-musl","zip:linux-arm64-musl":"zip -j bin/pickier-linux-arm64-musl.zip bin/pickier-linux-arm64-musl","zip:windows-x64":"zip -j bin/pickier-windows-x64.zip bin/pickier-windows-x64.exe","zip:windows-arm64":"zip -j bin/pickier-windows-arm64.zip bin/pickier-windows-arm64.exe","zip:darwin-x64":"zip -j bin/pickier-darwin-x64.zip bin/pickier-darwin-x64","zip:darwin-arm64":"zip -j bin/pickier-darwin-arm64.zip bin/pickier-darwin-arm64",prepublishOnly:"bun --bun run build && bun run compile:all && bun run zip",test:"PICKIER_NO_AUTO_CONFIG=1 bun test --coverage","test:core":"PICKIER_NO_AUTO_CONFIG=1 bun test test/core","test:format":"PICKIER_NO_AUTO_CONFIG=1 bun test test/format","test:lint":"PICKIER_NO_AUTO_CONFIG=1 bun test test/lint","test:rules":"PICKIER_NO_AUTO_CONFIG=1 bun test test/rules","test:rules:sort":"PICKIER_NO_AUTO_CONFIG=1 bun test test/rules/sort","test:rules:style":"PICKIER_NO_AUTO_CONFIG=1 bun test test/rules/style","test:rules:quality":"PICKIER_NO_AUTO_CONFIG=1 bun test test/rules/quality","test:rules:imports":"PICKIER_NO_AUTO_CONFIG=1 bun test test/rules/imports","test:rules:typescript":"PICKIER_NO_AUTO_CONFIG=1 bun test test/rules/typescript","test:rules:regexp":"PICKIER_NO_AUTO_CONFIG=1 bun test test/rules/regexp","test:plugin":"PICKIER_NO_AUTO_CONFIG=1 bun test test/plugin","test:watch":"PICKIER_NO_AUTO_CONFIG=1 bun test --watch"},I={"@stacksjs/clarity":"^0.3.24","@stacksjs/clapp":"^0.2.3"},O={"@stacksjs/ts-spell-check":"^0.1.0"},_={bunfig:"^0.15.13"},z={name:e,type:u,version:t,description:r,author:s,license:l,homepage:p,repository:b,bugs:m,keywords:c,exports:o,module:a,types:x,bin:d,files:w,scripts:k,dependencies:I,optionalDependencies:O,devDependencies:_};export{t as version,x as types,u as type,k as scripts,b as repository,O as optionalDependencies,e as name,a as module,l as license,c as keywords,p as homepage,w as files,o as exports,_ as devDependencies,r as description,I as dependencies,z as default,m as bugs,d as bin,s as author};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{D as H,k as G}from"./chunk-cbqydxbp.js";import{L as K}from"./chunk-h6ac3d60.js";import{readFileSync as M,statSync as N,writeFileSync as Q}from"fs";import{isAbsolute as R,resolve as T}from"path";import U from"process";async function w(k,j){let B=j.mode||"auto";if(B==="format"&&k.length===1&&!/[*?[\]{}()!]/.test(k[0]))try{let q=k[0],z=R(q)?q:T(U.cwd(),q);if(N(z).isFile()){let J=await H(j.config),D=M(z,"utf8"),E=G(D,J,z);if(j.check&&E!==D)return 1;if(j.write&&E!==D)Q(z,E,"utf8");return 0}}catch{}let{runLint:x}=await import("./chunk-96ebhnpj.js");if(B==="lint")return x(k,j);if(B==="format"){let q={...j,fix:!0,dryRun:!!j.check,ext:j.ext,_formatOnly:!0};return x(k,q)}if(!(j.fix===!0||j.write===!0||j.check===!0))return x(k,j);let I={...j,fix:!0,dryRun:!!j.check,ext:j.ext};return x(k,I)}
|
|
3
|
+
export{w as h};
|