pickier 0.1.71 → 0.1.72
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 +2 -2
- package/dist/{chunk-c82emw32.js → chunk-0rxvmb2a.js} +2 -2
- package/dist/chunk-1vnz0vyr.js +2 -0
- package/dist/chunk-50z6kpcq.js +2 -0
- package/dist/{chunk-wx92kdf9.js → chunk-513cs23x.js} +5 -5
- package/dist/chunk-96vhwdwy.js +3 -0
- package/dist/{chunk-99jrtc0c.js → chunk-bf41tx1b.js} +2 -2
- package/dist/chunk-cscys77z.js +2 -0
- package/dist/chunk-hx0z7dzw.js +29 -0
- package/dist/{chunk-5c026tb4.js → chunk-kn5s3eh8.js} +1 -1
- package/dist/chunk-m9saxre0.js +2 -0
- package/dist/chunk-mfns8s7h.js +124 -0
- package/dist/chunk-mgry8xhx.js +3 -0
- package/dist/{chunk-8m82hwdv.js → chunk-qq03kpe0.js} +2 -2
- package/dist/{chunk-qjzzx1m2.js → chunk-t0w79bj5.js} +25 -25
- package/dist/chunk-wz6hqyhd.js +2 -0
- package/dist/native/darwin-arm64/pickier-native +0 -0
- package/dist/native/darwin-x64/pickier-native +0 -0
- package/dist/native/linux-arm64/pickier-native +0 -0
- package/dist/native/linux-x64/pickier-native +0 -0
- package/dist/native/win32-arm64/pickier-native.exe +0 -0
- package/dist/native/win32-x64/pickier-native.exe +0 -0
- package/dist/src/index.js +1 -1
- package/dist/src/lint-worker.js +1 -1
- package/dist/src/parallel.d.ts +4 -0
- package/dist/src/rules/general/prefer-template.d.ts +12 -0
- package/package.json +1 -1
- package/dist/chunk-0b2yx624.js +0 -3
- package/dist/chunk-1jtr81zg.js +0 -25
- package/dist/chunk-3h389bm4.js +0 -2
- package/dist/chunk-6vptsmta.js +0 -128
- package/dist/chunk-gpfjzx90.js +0 -2
- package/dist/chunk-jerw13hn.js +0 -2
- package/dist/chunk-m9ym248d.js +0 -2
- package/dist/chunk-vrbz87a8.js +0 -3
- package/dist/chunk-xgm5reee.js +0 -2
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{te}from"./chunk-96vhwdwy.js";var i=null,r=null,l=!1,a=!0;function b(){if(l)return a;try{return i=(()=>{throw new Error("Cannot require module "+"@stacksjs/ts-spell-check");})(),i.SpellChecker.create({minWordLength:3,maxSuggestions:3}).then((n)=>{r=n}).catch(()=>{a=!1}),l=!0,!0}catch{return l=!0,a=!1,!1}}function u(n,t){return{meta:{docs:n==="spell/check"?"Check spelling in text content":n==="spell/check-comments"?"Check spelling in code comments only":"Check spelling in markdown files"},check(d,h){if(!b()||!i)return[];let{extractWords:C,parseDirectives:y,isSuppressed:L,getProgrammingWords:W}=i,f=h.options,c=new Set((f?.words||[]).map((s)=>s.toLowerCase())),P=f?.minWordLength||3,x=W(),g=y(d);for(let s of g)if(s.type==="word")s.words.forEach((o)=>c.add(o.toLowerCase()));let m=d.split(/\r?\n/),p=[];for(let s=0;s<m.length;s++){let o=m[s],k=s+1;if(t&&!t(o))continue;let R=C(o);for(let{word:e,offset:S}of R){if(e.length<P)continue;if(e===e.toUpperCase()&&e.length<=5)continue;if(c.has(e.toLowerCase()))continue;if(x.has(e.toLowerCase()))continue;if(L(e,k,g,c))continue;if(r){if(r.isCorrect(e))continue;let w=r.suggest(e);p.push({filePath:h.filePath,line:k,column:S+1,ruleId:n,message:`Unknown word: "${e}"`,severity:"warning",help:w.length?`Did you mean: ${w.slice(0,3).join(", ")}? Or add to config words.`:`Add "${e}" to your config words array, or use: // spell-check:ignore ${e}`})}}}return p}}}function v(n){let t=n.trimStart();return t.startsWith("//")||t.startsWith("/*")||t.startsWith("*")||t.startsWith("#")}var _={name:"spell",rules:{check:u("spell/check"),"check-comments":u("spell/check-comments",v),"check-markdown":{meta:{docs:"Check spelling in markdown files"},check(n,t){if(!t.filePath.endsWith(".md"))return[];return u("spell/check-markdown").check(n,t)}}}};export{_ as spellPlugin};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/src/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{l,
|
|
2
|
+
import{l,z,p,O,M,C,L,f,se,r,_,m,N,E,o,re,w,J,Y,Z,X,Q,ee,t,y,u,x,T,h,d,ie}from"../chunk-hx0z7dzw.js";import{H,W,A,U,K}from"../chunk-mfns8s7h.js";import"../chunk-bf41tx1b.js";import{B}from"../chunk-mgry8xhx.js";export{_ as ALWAYS_IGNORES,r as ENV,L as MAX_FIXER_PASSES,m as UNIVERSAL_IGNORES,X as blue,ee as bold,w as colorize,t as colors,z as config,d as createIgnoreMatcher,se as createLimiter,l as defaultConfig,O as detectQuoteIssues,x as expandPatterns,A as fixText,p as formatCode,C as formatImports,N as getRuleSetting,f as glob,Q as gray,J as green,M as hasIndentIssue,T as isCodeFile,re as isRuleOff,W as lintText,u as loadConfigFromPath,y as mergeConfig,E as normalizeRuleSeverity,Y as red,o as resolveRuleSeverity,B as run,H as runFormat,K as runLint,U as runLintProgrammatic,ie as shouldIgnorePath,h as withAlwaysIgnores,Z as yellow};
|
package/dist/src/lint-worker.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{u}from"../chunk-hx0z7dzw.js";import{R,v}from"../chunk-mfns8s7h.js";import"../chunk-bf41tx1b.js";var s,i=null;self.onmessage=async(n)=>{let t=n.data;if(t.type==="init"){s=t.options,i=u(s.config);return}try{let e=await i,o=[];for(let[r,a]of t.batch)o.push([r,await v(a,e,s)]);await R(),postMessage({type:"done",results:o})}catch(e){await R(),postMessage({type:"error",message:e?.message||String(e)})}};
|
package/dist/src/parallel.d.ts
CHANGED
|
@@ -13,5 +13,9 @@ export declare function workerThreadsFor(fileCount: number): number;
|
|
|
13
13
|
* could not finish (it failed to start, or crashed) is linted on this thread
|
|
14
14
|
* with `lintHere`, as is everything when no worker can be started. An error
|
|
15
15
|
* thrown while linting a file is rethrown here, as it would be on one thread.
|
|
16
|
+
*
|
|
17
|
+
* A worker that is out of files is parked for the next run rather than
|
|
18
|
+
* terminated, and one that reported an error is left to come to rest first:
|
|
19
|
+
* tearing a worker down while its siblings are running segfaults Bun (#1379).
|
|
16
20
|
*/
|
|
17
21
|
export declare function lintInWorkers(files: string[], options: LintOptions, count: number, lintHere: (file: string) => Promise<LintIssue[]>, entry?: string | null): Promise<LintIssue[][]>;
|
|
@@ -1,2 +1,14 @@
|
|
|
1
1
|
import type { RuleModule } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Prefer template literals over string concatenation
|
|
4
|
+
*
|
|
5
|
+
* Flags cases like: 'hello ' + name + '!'
|
|
6
|
+
* Suggests: `hello ${name}!`
|
|
7
|
+
*
|
|
8
|
+
* The patterns run over the masked source (lexer.ts), so only a `+` that is
|
|
9
|
+
* code is a candidate. A file that generates code holds lines of another
|
|
10
|
+
* program as strings, and a `+` in one of those - the first character of a
|
|
11
|
+
* message the generated program prints, say - is text with no concatenation
|
|
12
|
+
* to replace (#1380).
|
|
13
|
+
*/
|
|
2
14
|
export declare const preferTemplate: RuleModule;
|
package/package.json
CHANGED
package/dist/chunk-0b2yx624.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
var{defineProperty:e,getOwnPropertyNames:g,getOwnPropertyDescriptor:h}=Object,i=Object.prototype.hasOwnProperty;function j(a){return this[a]}var C=(a)=>{var b=(f??=new WeakMap).get(a),c;if(b)return b;if(b=e({},"__esModule",{value:!0}),a&&typeof a==="object"||typeof a==="function"){for(var d of g(a))if(!i.call(b,d))e(b,d,{get:j.bind(a,d),enumerable:!(c=h(a,d))||c.enumerable})}return f.set(a,b),b},f;var k=(a)=>a;function l(a,b){this[a]=k.bind(null,b)}var O=(a,b)=>{for(var c in b)e(a,c,{get:b[c],enumerable:!0,configurable:!0,set:l.bind(b,c)})};var _=(a,b,c)=>()=>{if(a)try{b=a(a=0)}catch(d){c=[d]}if(c)throw c[0];return b};var J=import.meta.require;
|
|
3
|
-
export{C,O,_,J};
|
package/dist/chunk-1jtr81zg.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{i,g}from"./chunk-c82emw32.js";import{readdirSync as Xe,readFileSync as Qe}from"fs";import{homedir as Ve}from"os";import{join as ce}from"path";var xe=["code-style","lint"],l={ignores:["**/node_modules/**","**/.pnpm/**","**/.yarn/**","**/dist/**","**/build/**","**/out/**","**/.output/**","**/.next/**","**/.nuxt/**","**/.vite/**","**/.turbo/**","**/.cache/**","**/coverage/**","**/vendor/**","**/pantry/**","**/tmp/**","**/.git/**","**/.idea/**","**/.vscode/**","**/.zed/**","**/.cursor/**","**/.claude/**","**/.github/**","**/*.test.ts","**/*.spec.ts","**/.bunpress/**","**/.vitepress/cache/**","**/storage/framework/stx/**","**/storage/framework/runtime/**","**/storage/cloud/**","**/*.lock","**/package-lock.json","**/pnpm-lock.yaml"],lint:{extensions:["ts","js","html","css","json","jsonc","md","yaml","yml","stx","sh","bash","zsh"],reporter:"stylish",cache:!1,maxWarnings:-1},format:{extensions:["ts","js","html","css","json","jsonc","md","yaml","yml","stx","sh","bash","zsh"],trimTrailingWhitespace:!0,maxConsecutiveBlankLines:1,finalNewline:"one",indent:2,indentStyle:"spaces",preserveCodeIndentation:!1,quotes:"single",semi:!1},rules:{noDebugger:"error",noConsole:"warn"},pluginRules:{"style/brace-style":"warn","style/curly":"off","style/if-newline":"off","style/max-statements-per-line":"warn","pickier/import-dedupe":"warn","pickier/no-import-node-modules-by-path":"error","pickier/no-import-dist":"error","pickier/prefer-const":"error","pickier/prefer-template":"warn","pickier/no-unused-vars":"error","pickier/no-unused-imports":"error","pickier/sort-tailwind-classes":"warn","regexp/no-unused-capturing-group":"error","regexp/no-super-linear-backtracking":"error","regexp/no-useless-lazy":"error","ts/no-top-level-await":"error","ts/member-delimiter-style":"off","ts/type-annotation-spacing":"off","style/comma-dangle":"off","style/keyword-spacing":"off","style/arrow-spacing":"off","style/space-infix-ops":"off","style/object-curly-spacing":"off","style/spaced-comment":"off","style/block-spacing":"off","style/space-before-blocks":"off","style/comma-spacing":"off","style/semi-spacing":"off","style/rest-spread-spacing":"off","style/key-spacing":"off","style/computed-property-spacing":"off","style/array-bracket-spacing":"off","style/space-in-parens":"off","style/template-curly-spacing":"off","style/space-unary-ops":"off","style/switch-colon-spacing":"off","style/arrow-parens":"off","style/space-before-function-paren":"off","style/quote-props":"off","style/no-floating-decimal":"off","style/new-parens":"off","style/no-extra-parens":"off","style/wrap-iife":"off","style/comma-style":"off","style/dot-location":"off","style/operator-linebreak":"off","style/multiline-ternary":"off","style/padded-blocks":"off","style/lines-between-class-members":"off","style/no-tabs":"off","style/no-mixed-spaces-and-tabs":"off","style/generator-star-spacing":"off","style/yield-star-spacing":"off","style/function-call-spacing":"off","style/template-tag-spacing":"off","style/no-whitespace-before-property":"off","style/no-mixed-operators":"off","style/indent-binary-ops":"off","ts/type-generic-spacing":"off","ts/type-named-tuple-spacing":"off","markdown/heading-increment":"warn","markdown/heading-style":"warn","markdown/no-missing-space-atx":"error","markdown/no-multiple-space-atx":"error","markdown/no-missing-space-closed-atx":"error","markdown/no-multiple-space-closed-atx":"error","markdown/blanks-around-headings":"warn","markdown/heading-start-left":"warn","markdown/no-duplicate-heading":"warn","markdown/single-title":"warn","markdown/no-trailing-punctuation":"warn","markdown/ul-style":"warn","markdown/list-indent":"error","markdown/ul-indent":"warn","markdown/ol-prefix":"warn","markdown/list-marker-space":"error","markdown/blanks-around-lists":"warn","markdown/no-trailing-spaces":"error","markdown/no-hard-tabs":"error","markdown/no-multiple-blanks":"warn","markdown/no-multiple-space-blockquote":"error","markdown/no-blanks-blockquote":"warn","markdown/blanks-around-fences":"warn","markdown/single-trailing-newline":"error","markdown/blanks-around-tables":"warn","markdown/no-reversed-links":"error","markdown/no-bare-urls":"warn","markdown/no-space-in-links":"error","markdown/no-empty-links":"error","markdown/link-fragments":"warn","markdown/reference-links-images":"warn","markdown/link-image-reference-definitions":"warn","markdown/link-image-style":"warn","markdown/descriptive-link-text":"warn","markdown/line-length":"off","markdown/commands-show-output":"warn","markdown/fenced-code-language":"warn","markdown/code-block-style":"off","markdown/code-fence-style":"warn","markdown/no-emphasis-as-heading":"warn","markdown/no-space-in-emphasis":"warn","markdown/no-space-in-code":"warn","markdown/emphasis-style":"warn","markdown/strong-style":"warn","markdown/no-inline-html":"off","markdown/hr-style":"warn","markdown/first-line-heading":"off","markdown/required-headings":"off","markdown/proper-names":"off","markdown/no-alt-text":"warn","markdown/table-pipe-style":"warn","markdown/table-column-count":"warn","markdown/table-column-style":"warn","lockfile/validate-host":["warn",{allowedHosts:["npm","yarn"]}],"lockfile/validate-https":"error","lockfile/validate-integrity":["warn",{requiredAlgorithm:"sha512"}],"lockfile/validate-package-names":"error","lockfile/validate-scheme":["error",{allowedSchemes:["https:","git+https:","git+ssh:"]}],"publint/exports-types-should-be-first":"error","publint/exports-default-should-be-last":"error","publint/exports-module-should-precede-require":"error","publint/exports-value-invalid":"error","publint/imports-key-invalid":"error","publint/imports-value-invalid":"error","publint/imports-default-should-be-last":"error","publint/imports-module-should-precede-require":"error","publint/use-type":"warn","publint/deprecated-field-jsnext":"warn","publint/field-invalid-value-type":"error","publint/local-dependency":"error","publint/has-module-but-no-exports":"warn","publint/exports-missing-root-entrypoint":"warn","publint/exports-fallback-array-use":"warn","publint/file-does-not-exist":"warn","publint/file-invalid-format":"warn","publint/module-should-be-esm":"error","publint/bin-file-not-executable":"error","publint/exports-module-should-be-esm":"error","shell/command-substitution":"error","shell/quote-variables":"warn","shell/no-cd-without-check":"warn","shell/no-eval":"error","shell/no-useless-cat":"warn","shell/shebang":"warn","shell/indent":"warn","shell/function-style":"warn","shell/operator-spacing":"warn","shell/keyword-spacing":"warn","shell/no-trailing-semicolons":"warn","shell/no-trailing-whitespace":"error","shell/prefer-double-brackets":"warn","shell/set-options":"off","shell/prefer-printf":"warn","shell/consistent-case-terminators":"warn","shell/no-broken-redirect":"error","shell/heredoc-indent":"warn","shell/no-ls-parsing":"warn","shell/no-variable-in-single-quotes":"warn","shell/no-exit-in-subshell":"warn","spell/check":"off","spell/check-comments":"off","spell/check-markdown":"off"},verbose:!0},Ze=new Set(["PICKIER_CONCURRENCY","PICKIER_DIAGNOSTICS","PICKIER_FAIL_ON_WARNINGS","PICKIER_NO_AUTO_CONFIG","PICKIER_RULE_TIMEOUT_MS","PICKIER_TIMEOUT_MS","PICKIER_TRACE","PICKIER_WORKERS"]),et=/^\.?(?:pickier|code-style|lint|config)(?:\.(?:pickier|code-style|lint|config))*\.(?:ts|js|mjs|cjs|mts|cts|json|jsonc)$/i,tt=new Set(["pickier",...xe]);function nt(e){for(let w of Object.keys(process.env))if(w.startsWith("PICKIER_")&&!Ze.has(w))return!0;let a=Ve(),n=[e,ce(e,"config"),ce(e,".config"),ce(a,".config","pickier"),ce(a,".config"),a];for(let w of n){let k;try{k=Xe(w,{withFileTypes:!0})}catch{continue}for(let C of k){if(C.isDirectory())continue;if(et.test(C.name))return!0}}let s;try{s=Qe(ce(e,"package.json"),"utf8")}catch{return!1}try{let w=JSON.parse(s);return w!==null&&typeof w==="object"&&Object.keys(w).some((k)=>tt.has(k))}catch{return!0}}var pe=null;async function Y(){if(!pe)if(!nt(process.cwd()))pe=l;else{let{loadConfig:e}=await import("./chunk-qjzzx1m2.js");pe=await e({name:"pickier",alias:[...xe],defaultConfig:l})}return pe}var W=l;var rt=new Set([".ts",".js"]),st=new Set([".json",".jsonc"]),it=new Set([".yaml",".yml"]),ot=new Set([".sh",".bash",".zsh",".ksh",".dash"]),at=new Set([".md",".mdx",".markdown"]),lt=/^#!\s*(?:\/usr\/bin\/env\s+)?(?:ba|z|k|da)?sh\b/;var ct=/^[}\])]/,ft=/\s*\/\/.*$/,ut=/^(?:if|else\s+if|for|while)\s*\(/,pt=/^(?:\.[\w$[]|\?[\s.:]|:\s|&&|\|\|)/;function dt(e){let a=e.charCodeAt(0);if(a!==105&&a!==101&&a!==102&&a!==119&&a!==100)return!1;let n=ut.exec(e);if(!n)return/^(?:else|do)\s*$/.test(e);let s=0,w=null;for(let k=n[0].length-1;k<e.length;k++){let C=e[k];if(w){if(C==="\\"){k++;continue}if(C===w)w=null;continue}if(C==="'"||C==='"'||C==="`"){w=C;continue}if(C==="(")s++;else if(C===")"){if(s--,s===0)return e.slice(k+1).trim().length===0}}return!1}var mt=/^\s*for\s*\(/,gt=new RegExp("^\\s*;\\s*$"),ht=new RegExp(";{2,}\\s*$"),yt=/([\w)])\{/g,wt=/\{(return|if|for|while|switch|const|let|var|function)\b/g,bt=/,(\S)/g,kt=/(?<![=!<>+\-*/%&|^?])=(?![=><])/g,Ct=/(\w)\+(\w)/g,xt=/(\w)-(\w)/g,St=/(\w)\*(\w)/g,Et=/(\w)\/(\w)/g,_t=new RegExp("(?<=\\S);([^\\s;])","g"),Rt=/([\w)\]])<(\d)/g,It=/([\w)\]])>(\d)/g,Se=/\s{2,}/g,Ee=/^\s*$/,Ot=/^\s*\/\//,_e=/^\s*\/\*/,vt=/^\s*import\b/,Re=/\bfrom\s*['"][^'"]+['"]|^\s*import\s+['"][^'"]+['"]/,At=/package\.json$/i,Tt=/[jt]sconfig(?:\..+)?\.json$/i,le=/[ \t]+$/,Nt=/^\n+/;function ue(e){let a=e.lastIndexOf(".");return a>=0?e.slice(a):""}function de(e){return rt.has(ue(e))}function Pt(e){return st.has(ue(e))}function $t(e){return it.has(ue(e))}function Mt(e){return at.has(ue(e))}function Lt(e){return ot.has(ue(e))}function jt(e,a){return Lt(e)||lt.test(a)}function Ft(e,a){let n=e.split(`
|
|
3
|
-
`),s=n.length,w=Array(s),k=a.format.indent,C=a.format.indentStyle==="tabs",x=0,A=new g,N=!1,O="",j=!1,D=0;for(let U=0;U<s;U++){let B=n[U];if(B.length===0||/^\s*$/.test(B)){w[U]="";continue}if(N){if(w[U]=B,B.trim()===O)N=!1,O="";continue}let se=i(B);if(se)N=!0,O=se;let re=0;while(re<B.length&&(B.charCodeAt(re)===32||B.charCodeAt(re)===9))re++;let F=B.slice(re).trimEnd();if(F.startsWith("#")&&U>0){let J=C?"\t".repeat(x):" ".repeat(x*k);w[U]=J+F;continue}let te=A.read(F);if(/^case\b/.test(F)&&/\bin\s*$/.test(F))D++,j=!0;if(/^esac\b/.test(F)){if(D=Math.max(0,D-1),D===0)j=!1}let ae=j&&/\)\s*$/.test(F)&&!/\$\(/.test(F)&&!/^\s*\(/.test(F)&&!F.startsWith("#"),oe=/^;[;&]\s*$/.test(F),_=/^(?:fi|done|esac|elif|else)\b/.test(F)||/^\}/.test(F);if(!te.continuation&&_)x=Math.max(0,x-1);if(!te.continuation&&oe)x=Math.max(0,x-1);let S=x+Number(te.continuation),ne=C?"\t".repeat(S):" ".repeat(S*k);if(w[U]=ne+F,te.continuation){if(te.closesHeader)x++;continue}if(/^then\b/.test(F)||/^do\b/.test(F)||/^else\b/.test(F))x++;else if(/^if\b/.test(F)&&/\bthen\s*$/.test(F))x++;else if(/^elif\b/.test(F)&&/\bthen\s*$/.test(F))x++;else if(/^(?:while|for|until)\b/.test(F)&&/\bdo\s*$/.test(F))x++;else if(/^case\b/.test(F)&&/\bin\s*$/.test(F))x++;else if(ae)x++;else if(/\{\s*$/.test(F)&&!F.startsWith("#"))x++}return w.join(`
|
|
4
|
-
`)}function Dt(e,a){try{let n=Bun.YAML.parse(e),s=a.format.indentStyle==="tabs"?"\t":a.format.indent;return Bun.YAML.stringify(n,null,s).split(`
|
|
5
|
-
`).map((k)=>k.replace(/[ \t]+$/,"")).join(`
|
|
6
|
-
`)}catch{return e}}var Ie=Array.from({length:129},(e,a)=>" ".repeat(a));function Wt(e){if(e<=0)return"";return e<Ie.length?Ie[e]:" ".repeat(e)}function Ut(e,a){if((a.format.indentStyle||"spaces")==="tabs")return"\t".repeat(Math.max(0,e));return Wt(Math.max(0,e*a.format.indent))}function Gt(e){return`'${e.slice(1,-1).replace(/\\"/g,'"')}'`}function Kt(e){return`"${e.slice(1,-1).replace(/\\'/g,"'")}"`}function Bt(e,a){for(let n=0;n<e.length;n++){if(e[n]==="\\"){n++;continue}if(e[n]===a)return!0}return!1}function zt(e,a,n){if(!de(n))return e;let s=e.split(`
|
|
7
|
-
`);for(let w=0;w<s.length;w++)s[w]=Me(s[w],a);return s.join(`
|
|
8
|
-
`)}function Me(e,a){let n=a==="single";if(n?!e.includes('"'):!e.includes("'"))return e;let s=[],w=0,k=0,C=0,x=0;while(w<e.length){let A=e[w];if(C===0){if(A==="/"){let N=e[w+1];if(N==="/")break;if(N==="*"){let O=e.indexOf("*/",w+2);w=O===-1?e.length:O+2;continue}if(Be(e,w)){let O=ze(e,w);if(O!==-1){w=O;continue}}w++;continue}if(A==='"'){C=2,x=w,w++;continue}if(A==="'"){C=1,x=w,w++;continue}if(A==="`"){C=3,w++;continue}w++}else if(C===3){if(A==="\\"){w+=2;continue}if(A==="`")C=0;w++}else{if(A==="\\"){w+=2;continue}if(A===(C===1?"'":'"')){let O=e.slice(x+1,w);if((C===2&&n||C===1&&!n)&&!Bt(O,n?"'":'"')){if(x>k)s.push(e.slice(k,x));if(C===2)s.push(Gt(`"${O}"`));else s.push(Kt(`'${O}'`));k=w+1}C=0,w++;continue}w++}}if(s.length===0)return e;if(k<e.length)s.push(e.slice(k));return s.join("")}function Ht(e){return e===123||e===44||e===61||e===43||e===45||e===42||e===47||e===59||e===60||e===62}var Jt=/\s/;function qt(e,a){let n=!1;for(let s=a;s<e.length;s++){let w=e.charCodeAt(s),k=w===32||w>=9&&w<=13||w>=128&&Jt.test(e[s]);if(k&&n)return!0;n=k}return!1}var Le=1,je=2,Fe=4,De=8,We=16,Ue=32;function ye(e){return e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57||e===95}function Yt(e){let a=0;for(let n=1;n<e.length-1;n++){let s=e.charCodeAt(n);if(s===43||s===45||s===42||s===47){if(ye(e.charCodeAt(n-1))&&ye(e.charCodeAt(n+1)))a|=s===43?Le:s===45?je:s===42?Fe:De}else if(s===60||s===62){let w=e.charCodeAt(n+1),k=e.charCodeAt(n-1);if(w>=48&&w<=57&&(ye(k)||k===41||k===93))a|=s===60?We:Ue}}return a}function Xt(e,a){if(a+e.length<4)return e;let n=0;while(n<e.length&&(e[n]===" "||e[n]==="\t"))n++;if(n<e.length){let A=e[n];if(A==="/"&&(e[n+1]==="/"||e[n+1]==="*"))return e;if(A==="*")return e}let s=!1;for(let A=n;A<e.length;A++)if(Ht(e.charCodeAt(A))){s=!0;break}if(!s)return e;let{text:w,strings:k}=tn(e),C=w;if(C.includes("{"))C=C.replace(yt,"$1 {"),C=C.replace(wt,"{ $1");if(C.includes(","))C=C.replace(bt,", $1");if(C.includes("="))C=C.replace(kt," = ");let x=Yt(C);if(x&Le)C=C.replace(Ct,"$1 + $2");if(x&je)C=C.replace(xt,"$1 - $2");if(x&Fe)C=C.replace(St,"$1 * $2");if(x&De)C=C.replace(Et,"$1 / $2");if(C.includes(";"))C=C.replace(_t,"; $1");if(x&We)C=C.replace(Rt,"$1 < $2");if(x&Ue)C=C.replace(It,"$1 > $2");if(qt(C,n))if(n>0){let A=C.slice(n);C=C.slice(0,n)+A.replace(Se," ")}else C=C.replace(Se," ");return k.length>0?nn(C,k):C}function me(e){let a=e[e.length-1];return a!==void 0&&a.t==="tmpl"}function Ge(e,a,n){a++;while(a<e.length){let s=e[a];if(s==="\\"){a+=2;continue}if(s===n)return a+1;a++}return a}function we(e,a){for(let s of a)if(s.t==="tmpl")s.start=-1;let n=0;while(n<e.length){let s=a[a.length-1],w=e[n];if(s===void 0||s.t==="interp"){if(w==="`"){a.push({t:"tmpl",start:n}),n++;continue}if(w==="'"||w==='"'){n=Ge(e,n,w);continue}if(w==="/"&&e[n+1]==="/")break;if(s!==void 0){if(w==="{"){s.braces++,n++;continue}if(w==="}"){if(s.braces===0)a.pop();else s.braces--;n++;continue}}n++}else{if(w==="\\"){n+=2;continue}if(w==="`"){a.pop(),n++;continue}if(w==="$"&&e[n+1]==="{"){a.push({t:"interp",braces:0}),n+=2;continue}n++}}if(me(a)){for(let s of a)if(s.t==="tmpl"&&s.start>=0)return s.start}return-1}function Oe(e,a){let n=a,s=null,w=0;while(w<e.length){let k=e[w];if(n){if(k==="*"&&e[w+1]==="/"){n=!1,w+=2;continue}w++;continue}if(s){if(k==="\\"){w+=2;continue}if(k===s)s=null;w++;continue}if(k==="'"||k==='"'||k==="`"){s=k,w++;continue}if(k==="/"){if(e[w+1]==="/")break;if(e[w+1]==="*"){n=!0,w+=2;continue}}w++}return n}function ve(e,a){let n=e.length,s=Array(n),w=a.format.quotes,k=a.format.semi===!0,C=0,x=0,A=!1,N=[];for(let O=0;O<n;O++){let j=e[O];if(A){A=Oe(j,!0),s[O]=j;continue}let D=me(N),U=-1;if(N.length>0||j.indexOf("`")!==-1)U=we(j,N);if(D){s[O]=j;continue}if(U<0&&N.length===0)A=j.includes("/*")&&Oe(j,!1);let B="",se=!1,re="";if(U>=0){B=j.slice(U);let J=j.slice(0,U);if(J.length===0){s[O]=B;continue}if(se=le.test(J),J.trim().length===0)re=J;j=J}if(j.length===0){s[O]="";continue}j=Me(j,w);let F=0;while(F<j.length&&(j.charCodeAt(F)===32||j.charCodeAt(F)===9))F++;let te=j.slice(F).trimEnd();if(ct.test(te))C=Math.max(0,C-1);let ae=pt.test(te)?1:0,oe=a.format.preserveCodeIndentation?j.slice(0,F):Ut(C+x+ae,a),_=te.charCodeAt(te.length-1);if(_===123||_===91||_===40)C+=1,x=0;else if(!te.startsWith("//")&&!te.startsWith("*")&&!te.startsWith("/*")){let J=te.includes("//")?te.replace(ft,""):te;x=dt(J)?x+1:0}let S=Xt(te,oe.length),ne=!1;if(k){if(!mt.test(S))if(gt.test(S))ne=!0;else S=S.replace(ht,";")}if(ne)j="";else if(a.format.trimTrailingWhitespace)S=S.trimEnd(),j=S.length===0?"":oe+S;else j=oe+S;if(U>=0){if(re)j=re;else if(se&&!le.test(j))j+=" ";j+=B}s[O]=j}return s}var Ae=/^[ \t]*(`{3,}|~{3,})(.*)$/,Qt=/^ {0,3}#{1,6}(?:[ \t]|$)/;function Vt(e,a){let n=a.format.trimTrailingWhitespace,s=Math.max(0,a.format.maxConsecutiveBlankLines),w=[],k=0,C="",x=0;for(let A=0;A<e.length;A++){let N=e[A];if(C!==""){let B=N.indexOf(C)!==-1?Ae.exec(N):null;if(B&&B[1][0]===C&&B[1].length>=x&&B[2].trim()==="")C="",w.push(n?N.replace(le,""):N);else w.push(N);continue}if(N.length===0||N.trim()===""){if(k++,k<=s)w.push("");continue}if(k=0,N.indexOf("```")!==-1||N.indexOf("~~~")!==-1){let B=Ae.exec(N);if(B&&!(B[1][0]==="`"&&B[2].includes("`"))){C=B[1][0],x=B[1].length,w.push(n?N.replace(le,""):N);continue}}let O=N.charCodeAt(N.length-1);if(!n||O!==32&&O!==9){w.push(N);continue}let j=N.replace(le,""),D=e[A+1],U=N.endsWith(" ")&&D!==void 0&&D.trim()!==""&&!Qt.test(N);w.push(U?`${j} `:j)}return w}function Zt(e,a){let n=[],s=0,w=[];for(let k of e){let C=me(w);if(w.length>0||k.indexOf("`")!==-1)we(k,w);if(C){n.push(k),s=0;continue}if(k===""){if(s++,s<=a)n.push("")}else s=0,n.push(k)}return n}function d(e,a,n){if(e.length===0)return"";let w=(e.includes("\r")?e.replace(/\r\n/g,`
|
|
9
|
-
`):e).split(`
|
|
10
|
-
`),k;if(Mt(n))k=Vt(w,a);else if(a.format.trimTrailingWhitespace){k=[];let x=0,A=Math.max(0,a.format.maxConsecutiveBlankLines),N=[];for(let O of w){let j=me(N),D=!1;if(N.length>0||O.indexOf("`")!==-1)D=we(O,N)>=0;if(j||D){k.push(O),x=0;continue}let U=O[O.length-1],B=U===" "||U==="\t"?O.replace(le,""):O;if(B===""){if(x++,x<=A)k.push("")}else x=0,k.push(B)}}else k=Zt(w,Math.max(0,a.format.maxConsecutiveBlankLines));let C;if(de(n)&&!(k.length>0&&k[0].startsWith("#!"))){let x=0;while(x<k.length&&k[x]==="")x++;if(x>0)k=k.slice(x);return k=He(k)??k,C=ve(k,a).join(`
|
|
11
|
-
`),Te(C,a)}if(C=k.join(`
|
|
12
|
-
`),C=C.replace(Nt,""),de(n))C=R(C);if($t(n)){let x=Dt(C,a);if(x!==C)C=x}if(Pt(n)){let x=an(C,n);if(x!=null)C=x}if(jt(n,C))C=Ft(C,a);else if(de(n))C=ve(C.split(`
|
|
13
|
-
`),a).join(`
|
|
14
|
-
`);else C=zt(C,a.format.quotes,n);return Te(C,a)}function Te(e,a){let n=e.length;while(n>0&&e.charCodeAt(n-1)===10)n--;if(a.format.finalNewline==="none")return n===e.length?e:e.slice(0,n);let s=a.format.finalNewline==="two"?`
|
|
15
|
-
|
|
16
|
-
`:`
|
|
17
|
-
`;if(e.length-n===s.length)return e;return e.slice(0,n)+s}function Ne(e,a,n,s){for(let w=a+1;w<e.length;w++){let k=e[w];if(k==="\\"){w++;continue}if(k===n)return!0;if(k===s)return!1}return!0}function M(e,a){if(/^\s*\/\/\/\s*<reference/.test(e))return[];let n=[],s=null,w=!1;for(let k=0;k<e.length;k++){let C=e[k];if(w){w=!1;continue}if(C==="\\"){w=!0;continue}if(!s){if(C==="/"&&e[k+1]==="/")break;if(C==="'"){if(a==="double"&&Ne(e,k,"'",'"'))n.push(k);s="single";continue}else if(C==='"'){if(a==="single"&&Ne(e,k,'"',"'"))n.push(k);s="double";continue}else if(C==="`"){s="template";continue}}else if(s==="single"&&C==="'"||s==="double"&&C==='"'||s==="template"&&C==="`"){s=null;continue}}return n}function E(e,a,n="spaces",s){if(n==="tabs")return/[^\t]/.test(e);if(/\t/.test(e))return!0;let w=e.length;if(s&&w%a===1){let k=s.trimStart();if(k.startsWith("* ")||k.startsWith("*/")||k==="*")return!1}return w%a!==0}function Ke(e,a){let n=a+1;while(n<e.length){let s=e[n];if(s==="\\"){n+=2;continue}if(s==="`")return n+1;if(s==="$"&&e[n+1]==="{"){n+=2;let w=1;while(n<e.length&&w>0){let k=e[n];if(k==="\\"){n+=2;continue}if(k==="`"){n=Ke(e,n);continue}if(k==="'"||k==='"'){n=Ge(e,n,k);continue}if(k==="{")w++;else if(k==="}")w--;n++}continue}n++}return n}var en=new Set(["return","typeof","instanceof","in","of","new","delete","void","do","else","case","yield","await"]);function Be(e,a){let n=a-1;while(n>=0&&(e[n]===" "||e[n]==="\t"))n--;if(n<0)return!0;let s=e[n];if("(,=:[!&|?;{}<>+-*%^~".includes(s))return!0;if(/[\w$]/.test(s)){let w=n;while(w>=0&&/[\w$]/.test(e[w]))w--;return en.has(e.slice(w+1,n+1))}return!1}function ze(e,a){let n=a+1,s=!1,w=-1;while(n<e.length){let k=e[n];if(k==="\\"){n+=2;continue}if(k==="["&&!s)s=!0,w=n;else if(k==="]"&&s){let C=e[w+1]==="^"?w+2:w+1;if(n!==C)s=!1}else if(k==="/"&&!s){n++;while(n<e.length&&/[a-z]/i.test(e[n]))n++;return n}n++}return-1}function tn(e){if(!e.includes("'")&&!e.includes('"')&&!e.includes("`")&&!e.includes("/"))return{text:e,strings:[]};let a=[],n=[],s=0,w=0;while(s<e.length){let k=e[s];if(k==="/"){let C=e[s+1];if(C==="/"){if(s>w)n.push(e.slice(w,s));a.push(e.slice(s)),n.push(`@@S${a.length-1}@@`),w=e.length;break}if(C==="*"){let x=e.indexOf("*/",s+2),A=x===-1?e.length:x+2;if(s>w)n.push(e.slice(w,s));a.push(e.slice(s,A)),n.push(`@@S${a.length-1}@@`),s=A,w=s;continue}if(Be(e,s)){let x=ze(e,s);if(x!==-1){if(s>w)n.push(e.slice(w,s));a.push(e.slice(s,x)),n.push(`@@S${a.length-1}@@`),s=x,w=s;continue}}s++;continue}if(k==="'"||k==='"'||k==="`"){if(s>w)n.push(e.slice(w,s));let C=s;if(k==="`")s=Ke(e,s);else{let x=k;s++;while(s<e.length){if(e[s]==="\\"){s+=2;continue}if(e[s]===x){s++;break}s++}}a.push(e.slice(C,s)),n.push(`@@S${a.length-1}@@`),w=s;continue}s++}if(w<e.length)n.push(e.slice(w));return{text:n.join(""),strings:a}}function nn(e,a){if(a.length===0)return e;let n="",s=0,w=e.indexOf("@@S");while(w!==-1){let k=w+3;while(k<e.length&&e.charCodeAt(k)>=48&&e.charCodeAt(k)<=57)k++;if(k>w+3&&e.charCodeAt(k)===64&&e.charCodeAt(k+1)===64)n+=e.slice(s,w)+(a[Number(e.slice(w+3,k))]??""),s=k+2,w=e.indexOf("@@S",s);else w=e.indexOf("@@S",w+1)}return s===0?e:n+e.slice(s)}function Pe(e){return e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57||e===95||e===36}function rn(e,a){let n=0;while(!0){let s=e.indexOf(a,n);if(s===-1)return!1;if(n=s+1,Pe(e.charCodeAt(s+a.length)))continue;let w=s-1,k=!0;while(w>=0){let C=e.charCodeAt(w);if(!Pe(C))break;if(C<48||C>57){k=!1;break}w--}if(k)return!0}}function R(e){let a=e[0];if(a!=="i"&&a!==" "&&a!=="\t"&&a!=="/"&&a!==`
|
|
18
|
-
`)return e;let n=He(e.split(`
|
|
19
|
-
`));return n===null?e:n.join(`
|
|
20
|
-
`)}function He(e){let a=e.length===0?void 0:e[0].length>0?e[0][0]:e.length>1?`
|
|
21
|
-
`:void 0;if(a!=="i"&&a!==" "&&a!=="\t"&&a!=="/"&&a!==`
|
|
22
|
-
`)return null;let n=[],s=[],w=[],k=0,C=0,x=-1,A=!1;while(k<e.length){let _=e[k];if(Ee.test(_)){k++;continue}if(Ot.test(_)||_e.test(_)){let ee=k;if(_e.test(_)){while(k<e.length&&!e[k].includes("*/"))k++;k++}else k++;if(!A){for(let ie=ee;ie<k&&ie<e.length;ie++)s.push(e[ie]);C=k}else if(x<0)x=ee;continue}if(!vt.test(_))break;let S=_.trim(),ne=k+1;while(!Re.test(S)&&ne<e.length&&ne-k<50)S+=` ${e[ne].trim()}`,ne++;if(!Re.test(S))return null;let J=on(S);if(!J)return null;if(x>=0){for(let ee=x;ee<k;ee++)if(!Ee.test(e[ee]))w.push(e[ee]);x=-1}n.push(J),k=ne,C=k,A=!0}if(n.length===0)return null;let N=x>=0?x:C,O=e.slice(N),j=0;while(j<O.length&&O[j]==="")j++;let D=j===0?O:O.slice(j),U=new Map,B=(_)=>{let S=U.get(_);if(S===void 0){S=!1;for(let ne of O)if(rn(ne,_)){S=!0;break}U.set(_,S)}return S};for(let _ of n){if(_.kind!=="value")continue;_.named=_.named.filter((S)=>{if(S.alias)return!0;return B(S.name)})}let se=n.filter((_)=>{if(_.kind==="side-effect")return!0;if(_.kind==="type")return _.namedTypes.length>0;return Boolean(_.defaultName||_.namespaceName||_.named.length>0)}),re=new Map;for(let _ of se){let S=re.get(_.source)||{};if(_.kind==="side-effect")S.side=S.side||[],S.side.push(_);else if(_.kind==="type"){if(!S.type)S.type={kind:"type",source:_.source,named:[],namedTypes:[],original:""};S.type.namedTypes=(S.type.namedTypes||[]).concat(_.namedTypes)}else{if(!S.value)S.value={kind:"value",source:_.source,named:[],namedTypes:[],original:""};if(_.defaultName)S.value.defaultName=_.defaultName;if(_.namespaceName)S.value.namespaceName=_.namespaceName;if(S.value.named=(S.value.named||[]).concat(_.named),_.namedTypes.length>0){if(!S.type)S.type={kind:"type",source:_.source,named:[],namedTypes:[],original:""};S.type.namedTypes=S.type.namedTypes.concat(_.namedTypes)}}re.set(_.source,S)}let F=[];for(let[_,S]of re){if(S.side)F.push(...S.side);if(S.value){let ne=(J)=>{if(!J.alias)return J;return/^[A-Z]$/i.test(J.name)&&/^[A-Z]$/i.test(J.alias)?{name:J.alias,alias:J.name}:J};S.value.named=S.value.named.map(ne),S.value.named.sort((J,ee)=>J.name.localeCompare(ee.name)),F.push(S.value)}if(S.type&&S.type.namedTypes.length>0){let ne=new Set,J=(ee)=>{if(!ee.alias)return ee;return/^[A-Z]$/i.test(ee.name)&&/^[A-Z]$/i.test(ee.alias)?{name:ee.alias,alias:ee.name}:ee};S.type.namedTypes=S.type.namedTypes.map(J).filter((ee)=>{let ie=`${ee.name}|${ee.alias||""}`;if(ne.has(ie))return!1;return ne.add(ie),!0}),S.type.namedTypes.sort((ee,ie)=>ee.name.localeCompare(ie.name)),F.push(S.type)}}let te=(_)=>_.startsWith(".")?2:_.startsWith("node:")?0:1,ae=(_)=>{if(_.kind!=="value")return 99;if(_.defaultName)return 0;if(_.namespaceName)return 1;return 2};if(F.sort((_,S)=>{if(_.kind!==S.kind){if(_.kind==="type")return-1;if(S.kind==="type")return 1;if(_.kind==="side-effect")return-1;if(S.kind==="side-effect")return 1}if(_.kind==="type"&&S.kind==="type"){let ne=te(_.source),J=te(S.source);if(ne!==J)return ne-J;return _.source.localeCompare(S.source)}if(_.kind==="value"&&S.kind==="value"){let ne=te(_.source),J=te(S.source);if(ne!==J)return ne-J;let ee=ae(_),ie=ae(S);if(ee!==ie)return ee-ie;return _.source.localeCompare(S.source)}return _.source.localeCompare(S.source)}),F.length===0){if(s.length>0||w.length>0)return[...s,...w,...D.length>0?D:[""]];return D}let oe=[...s];for(let _ of F){let S=sn(_);if(S.includes(`
|
|
23
|
-
`))oe.push(...S.split(`
|
|
24
|
-
`));else oe.push(S)}return oe.push(...w),oe.push(""),oe.push(...D),oe}function sn(e){if(e.kind==="side-effect")return`import '${e.source}'`;if(e.kind==="type")return`import type { ${e.namedTypes.map((w)=>w.alias?`${w.name} as ${w.alias}`:w.name).join(", ")} } from '${e.source}'`;let a=[];if(e.defaultName)a.push(e.defaultName);if(e.namespaceName)a.push(`* as ${e.namespaceName}`);if(e.named.length>0){let s=e.named.map((w)=>w.alias?`${w.name} as ${w.alias}`:w.name).join(", ");a.push(`{ ${s} }`)}return`import ${a.join(", ")} from '${e.source}'`}function on(e){let a=e.match(/^\s*import\s+['"]([^'"]+)['"]/);if(a)return{kind:"side-effect",source:a[1],named:[],namedTypes:[],original:e};if(a=e.match(/^\s*import\s+type\s+\{([^}]*)\}\s+from\s+['"]([^'"]+)['"]/),a){let D=a[1],U=a[2],B=D.split(",").map((se)=>se.trim()).filter(Boolean).map((se)=>{let re=se.match(/^(\w+)(?:\s+as\s+(\w+))?$/);return{name:re?.[1]||se,alias:re?.[2]}});return{kind:"type",source:U,named:[],namedTypes:B,original:e}}let n=e.match(/^\s*import\s+/),s=new RegExp(`\\sfrom\\s+['"]([^'"]+)['"]\\s*;?$`),w=e.match(s);if(!n||!w)return;let k=w[1],C=e.slice(n[0].length,w.index).trim(),x,A,N=[],O=[],j=C.match(/\{([^}]*)\}/);if(j){let U=j[1].split(",").map((B)=>B.trim()).filter(Boolean);for(let B of U){let se=/^type\s+/.test(B),F=B.replace(/^type\s+/,"").match(/^(\w+)(?:\s+as\s+(\w+))?$/);if(!F)continue;let te={name:F[1],alias:F[2]};if(se)O.push(te);else N.push(te)}C=C.replace(/\{[\s\S]*?\}/,"").trim()}if(C.length>0){let D=C.split(",").map((U)=>U.trim()).filter(Boolean);for(let U of D)if(U.startsWith("* as "))A=U.slice(5).trim();else if(/^\w+$/.test(U))x=U}return{kind:"value",source:k,defaultName:x,namespaceName:A,named:N,namedTypes:O,original:e}}function an(e,a){if(At.test(a))return ln(e);if(Tt.test(a))return cn(e);return null}function Je(e){try{return JSON.parse(e)}catch{return null}}function fe(e,a,n=[]){let s={};for(let k of a)if(Object.prototype.hasOwnProperty.call(e,k))s[k]=e[k];for(let k of n){let C=Object.keys(e).filter((x)=>k.test(x)&&!(x in s)).sort();for(let x of C)s[x]=e[x]}let w=Object.keys(e).filter((k)=>!(k in s)).sort();for(let k of w)s[k]=e[k];return s}function $e(e){let a={};for(let n of Object.keys(e).sort())a[n]=e[n];return a}function ln(e){let a=Je(e);if(!a||typeof a!=="object")return e;let s=fe(a,["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(s.files)){if(s.files.every((C)=>typeof C==="string"))s.files=[...s.files].sort()}for(let k of Object.keys(s))if(/^(?:dev|peer|optional|bundled)?[Dd]ependencies(?:Meta)?$/.test(k)||/^(?:resolutions|overrides|pnpm\.overrides)$/.test(k)){if(s[k]&&typeof s[k]==="object")s[k]=$e(s[k])}if(s.pnpm&&typeof s.pnpm==="object"&&s.pnpm.overrides&&typeof s.pnpm.overrides==="object")s.pnpm.overrides=$e(s.pnpm.overrides);if(s.exports&&typeof s.exports==="object"){let k=s.exports,C=["types","import","require","default"];if(!Array.isArray(k)){let x={};for(let A of Object.keys(k)){let N=k[A];if(N&&typeof N==="object"&&!Array.isArray(N))x[A]=fe(N,C);else x[A]=N}s.exports=x}}let w=["pre-commit","prepare-commit-msg","commit-msg","post-commit","pre-rebase","post-rewrite","post-checkout","post-merge","pre-push","pre-auto-gc"];for(let k of["gitHooks","husky","simple-git-hooks"])if(s[k]&&typeof s[k]==="object")s[k]=fe(s[k],w);return JSON.stringify(s,null,2)}function cn(e){let a=Je(e);if(!a||typeof a!=="object")return e;let s=fe(a,["extends","compilerOptions","references","files","include","exclude"]);if(s.compilerOptions&&typeof s.compilerOptions==="object"){let w=["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"];s.compilerOptions=fe(s.compilerOptions,w)}return JSON.stringify(s,null,2)}import{readdirSync as fn,readFileSync as un,statSync as ke}from"fs";import{extname as pn,isAbsolute as ge,join as he,resolve as dn}from"path";var P=5;function mn(e){let a="",n=0;while(n<e.length){let s=e[n];if(s==="*")if(e[n+1]==="*"){if(a+=".*",n+=2,e[n]==="/")n++}else a+="[^/]*",n++;else if(s==="?")a+="[^/]",n++;else if(s==="["){let w=e.indexOf("]",n);if(w===-1)a+="\\[",n++;else a+=e.slice(n,w+1),n=w+1}else if(".+^${}()|\\".includes(s))a+=`\\${s}`,n++;else a+=s,n++}return new RegExp(`^${a}$`)}function*Ye(e,a,n){let s;try{s=fn(e)}catch{return}for(let w of s){if(!n&&w.startsWith("."))continue;let k=he(e,w);if(a(k))continue;let C;try{C=ke(k)}catch{continue}if(C.isDirectory())yield*Ye(k,a,n);else yield k}}function*qe(e,a,n,s){yield*Ye(e,h(a,s),n)}async function u(e,a={}){let n=a.cwd??process.cwd(),s=a.ignore??[],w=a.dot??!1,k=a.absolute??!0,C=h(s,n);if(typeof globalThis.Bun?.Glob<"u"){let A=globalThis.Bun.Glob,N=[];for(let O of e){if(!/[*?[{]/.test(O)){let D=ge(O)?O:he(n,O);if(ke(D,{throwIfNoEntry:!1})?.isFile()){if(!C(D))N.push(k?D:D.startsWith(`${n}/`)?D.slice(n.length+1):D);continue}}let j=new A(O);for await(let D of j.scan({cwd:n,dot:w,onlyFiles:a.onlyFiles??!0,followSymlinks:!1})){let U=ge(D)?D:he(n,D),B=U.startsWith(`${n}/`)?U.slice(n.length+1):U;if(C(U))continue;N.push(k?U:B)}}return N}let x=[];for(let A of e){if(!/[*?[{]/.test(A)){let O=ge(A)?A:he(n,A);try{if(!ke(O).isDirectory()){let D=O.startsWith(`${n}/`)?O.slice(n.length+1):O;if(!C(O))x.push(k?O:D)}else for(let D of qe(O,s,w,n))x.push(k?D:D.startsWith(`${n}/`)?D.slice(n.length+1):D)}catch{}continue}let N=mn(A);for(let O of qe(n,s,w,n)){let j=O.startsWith(`${n}/`)?O.slice(n.length+1):O;if(N.test(j)||N.test(j.replace(/\\/g,"/")))x.push(k?O:j)}}return x}function Z(e){let a=0,n=[],s=()=>{if(n.length>0&&a<e)a++,n.shift()()};return(w)=>new Promise((k,C)=>{let x=()=>{w().then((A)=>{a--,k(A),s()},(A)=>{a--,C(A),s()})};if(a<e)a++,x();else n.push(x)})}var r={get TRACE(){return process.env.PICKIER_TRACE==="1"},get TIMEOUT_MS(){return Number(process.env.PICKIER_TIMEOUT_MS||"8000")},get RULE_TIMEOUT_MS(){return Number(process.env.PICKIER_RULE_TIMEOUT_MS||"5000")},get CONCURRENCY(){return Number(process.env.PICKIER_CONCURRENCY)||8},get DIAGNOSTICS(){return process.env.PICKIER_DIAGNOSTICS==="1"},get FAIL_ON_WARNINGS(){return process.env.PICKIER_FAIL_ON_WARNINGS==="1"},get NO_AUTO_CONFIG(){return process.env.PICKIER_NO_AUTO_CONFIG==="1"},get WORKERS(){let e=process.env.PICKIER_WORKERS;if(e===void 0||e==="")return null;let a=Number(e);return Number.isFinite(a)?Math.max(0,Math.floor(a)):null}},L=["**/node_modules/**","**/.git/**"],f=["**/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 T(e,a){let n=e[a];if(n===void 0){let k=a.indexOf("/");if(k>0){let C=a.slice(0,k),x=a.slice(k+1),A=C==="general"?"pickier":C==="pickier"?"general":null;if(A)n=e[`${A}/${x}`];if(n===void 0)n=e[x]}}let s,w;if(typeof n==="string"){if(n==="error")s="error";else if(n==="warn"||n==="warning")s="warning"}else if(Array.isArray(n)&&typeof n[0]==="string"){let k=n[0];if(k==="error")s="error";else if(k==="warn"||k==="warning")s="warning";w=n[1]}return{enabled:!!s,severity:s,options:w}}function v(e){let a=Array.isArray(e)?e[0]:e;if(typeof a!=="string")return;if(a==="off")return"off";if(a==="error")return"error";if(a==="warn"||a==="warning")return"warning";return}function o(e,a,n=[],s){for(let k of[a,...n]){let C=v(e.rules?.[k])??v(e.pluginRules?.[k]);if(C)return C==="off"?void 0:C}let w=v(s);return w==="off"?void 0:w}function X(e,a){return v(e.rules?.[a])==="off"||v(e.pluginRules?.[a])==="off"}function y(e,a){return`\x1B[${e}m${a}\x1B[0m`}function V(e){return y("32",e)}function K(e){return y("31",e)}function z(e){return y("33",e)}function q(e){return y("34",e)}function G(e){return y("90",e)}function H(e){return y("1",e)}var t={green:V,red:K,yellow:z,blue:q,gray:G,bold:H};function p(e,a){let n=a.ignores?[...new Set([...e.ignores||[],...a.ignores])]:e.ignores,s={...e.pluginRules||{},...a.pluginRules||{}};if((a.tailwind??e.tailwind)?.enabled&&!Object.prototype.hasOwnProperty.call(s,"pickier/sort-tailwind-classes"))s["pickier/sort-tailwind-classes"]="warn";return{...e,...a,verbose:a.verbose??e.verbose,ignores:n,lint:{...e.lint,...a.lint||{}},format:{...e.format,...a.format||{}},rules:{...e.rules,...a.rules||{}},pluginRules:s}}var be=null;async function c(e){if(!e){if(r.NO_AUTO_CONFIG){if(!be)be=p(l,{});return be}try{let{getConfig:s}=await import("./chunk-m9ym248d.js"),w=await s();return p(l,w)}catch{}return p(l,{})}let a=ge(e)?e:dn(process.cwd(),e);if(pn(a).toLowerCase()===".json")try{let s=un(a,"utf8");return p(l,JSON.parse(s))}catch{return console.warn(`[pickier:warn] Config file not found: ${a}. Using default config values.`),p(l,{})}try{let s=await import(a);return p(l,s.default||s)}catch{return console.warn(`[pickier:warn] Config file not found: ${a}. Using default config values.`),p(l,{})}}function b(e){return e.map((a)=>{if(/[*?[\]{}()!]/.test(a))return a;if(/\.[A-Z0-9]+$/i.test(a))return a;return`${a.replace(/\/$/,"")}/**/*`})}function I(e,a){let n=e.lastIndexOf(".");if(n<0)return!1;let s=e.slice(n);return a.has(s)}function Ce(e){if(!e.includes("\\")&&!e.includes("//"))return e;return e.replace(/\\/g,"/").replace(/\/+/g,"/")}function gn(e){let a=[];for(let n of e){let s=Ce(n.trim());if(!s)continue;let w=s.match(/\*\*\/\*\.(.+)$/);if(w){a.push({raw:s,kind:"extension",value:w[1]});continue}let k=s.match(/\*\*\/(.+?)\/\*\*$/);if(k){a.push({raw:s,kind:"segment",value:k[1]});continue}let C=s.match(/\*\*\/(.+)$/);if(C)a.push({raw:s,kind:"suffix",value:C[1].replace(/\/$/,"")})}return a}function m(e){return[...new Set([...L,...e])]}function h(e,a=process.cwd()){let n=gn([...L,...e]);if(n.length===0)return()=>!1;let s=new Set([...f,...L]),w=Ce(a).replace(/\/$/,""),k=`${w}/`,C=n.map((x)=>({pattern:x,universal:s.has(x.raw),suffix:x.kind==="extension"?`.${x.value}`:`/${x.value}`,inner:`/${x.value}/`}));return(x)=>{let A=Ce(x),N=A!==w&&!A.startsWith(k),O=N?A:A.slice(w.length);for(let{pattern:j,universal:D,suffix:U,inner:B}of C){if(N&&!D)continue;if(j.kind==="extension"){if(O.endsWith(U))return!0;continue}if(j.kind==="segment"||j.kind==="suffix"){if(O.includes(B)||O.endsWith(U))return!0}}return!1}}function Q(e,a){return h(a)(e)}
|
|
25
|
-
export{l,Y,W,d,M,E,R,P,u,Z,r,L,f,T,v,o,X,y,V,K,z,q,G,H,t,p,c,b,I,m,h,Q};
|
package/dist/chunk-3h389bm4.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{ee,te,A,ne,se,re,ie,oe,ae,le,ce,ue,fe,me,he,de,pe,ge,ye,be}from"./chunk-99jrtc0c.js";export{se as author,me as bin,ae as bugs,be as default,pe as dependencies,ne as description,ye as devDependencies,ce as exports,he as files,ie as homepage,le as keywords,re as license,ue as module,ee as name,ge as optionalDependencies,oe as repository,de as scripts,te as type,fe as types,A as version};
|