pickier 0.1.68 → 0.1.69
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-0wjnsb7e.js +3 -0
- package/dist/chunk-1c4363f9.js +3 -0
- package/dist/chunk-1gsmqw00.js +2 -0
- package/dist/chunk-1r811fef.js +9 -0
- package/dist/chunk-861zc8zq.js +2 -0
- package/dist/chunk-9nk05dhr.js +3 -0
- package/dist/chunk-9w2q7ghj.js +2 -0
- package/dist/chunk-acdw0br0.js +3 -0
- package/dist/chunk-dqv1qww5.js +128 -0
- package/dist/chunk-dxrcbgyc.js +49 -0
- package/dist/chunk-he3fbz3w.js +8 -0
- package/dist/chunk-hyabhvem.js +2 -0
- package/dist/chunk-jqsghmew.js +3 -0
- package/dist/chunk-t4eg5fx5.js +41 -0
- package/dist/chunk-vjsh2bkt.js +25 -0
- package/dist/chunk-w7q10fyj.js +2 -0
- package/dist/chunk-yvrap76h.js +3 -0
- package/dist/chunk-zp6n036m.js +61 -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/cache.d.ts +21 -0
- package/dist/src/index.js +1 -1
- package/dist/src/lexer.d.ts +2 -0
- package/dist/src/lint-worker.d.ts +1 -0
- package/dist/src/lint-worker.js +2 -0
- package/dist/src/linter.d.ts +17 -1
- package/dist/src/logger.d.ts +20 -0
- package/dist/src/native.d.ts +64 -0
- package/dist/src/parallel.d.ts +17 -0
- package/dist/src/plugins/lazy.d.ts +10 -0
- package/dist/src/plugins/manifest.d.ts +123 -0
- package/dist/src/plugins/utils.d.ts +6 -0
- package/dist/src/rules/style/consistent-list-newline.d.ts +2 -0
- package/dist/src/types.d.ts +1 -0
- package/dist/src/utils.d.ts +1 -0
- package/package.json +3 -2
- package/dist/chunk-5dpt7qv4.js +0 -2
- package/dist/chunk-ek25vxkw.js +0 -2
- package/dist/chunk-jcy3sgzh.js +0 -2
- package/dist/chunk-q47v401h.js +0 -92
- package/dist/chunk-s0n5r5hb.js +0 -227
- package/dist/chunk-zeaz9zt8.js +0 -2
- package/dist/src/plugins/index.d.ts +0 -2
- package/dist/src/plugins/lockfile.d.ts +0 -22
- package/dist/src/plugins/markdown.d.ts +0 -2
- package/dist/src/plugins/publint.d.ts +0 -10
- package/dist/src/plugins/shell.d.ts +0 -2
- package/dist/src/plugins/spell.d.ts +0 -3
- package/dist/src/rules/lockfile/parser.d.ts +0 -85
- package/dist/src/rules/lockfile/validate-host.d.ts +0 -18
- package/dist/src/rules/lockfile/validate-https.d.ts +0 -14
- package/dist/src/rules/lockfile/validate-integrity.d.ts +0 -19
- package/dist/src/rules/lockfile/validate-package-names.d.ts +0 -23
- package/dist/src/rules/lockfile/validate-scheme.d.ts +0 -17
- package/dist/src/rules/markdown/_fence-tracking.d.ts +0 -70
- package/dist/src/rules/markdown/_shared.d.ts +0 -9
- package/dist/src/rules/markdown/blanks-around-fences.d.ts +0 -5
- package/dist/src/rules/markdown/blanks-around-headings.d.ts +0 -5
- package/dist/src/rules/markdown/blanks-around-lists.d.ts +0 -5
- package/dist/src/rules/markdown/blanks-around-tables.d.ts +0 -5
- package/dist/src/rules/markdown/code-block-style.d.ts +0 -5
- package/dist/src/rules/markdown/code-fence-style.d.ts +0 -5
- package/dist/src/rules/markdown/commands-show-output.d.ts +0 -5
- package/dist/src/rules/markdown/descriptive-link-text.d.ts +0 -5
- package/dist/src/rules/markdown/emphasis-style.d.ts +0 -5
- package/dist/src/rules/markdown/fenced-code-language.d.ts +0 -5
- package/dist/src/rules/markdown/first-line-heading.d.ts +0 -5
- package/dist/src/rules/markdown/heading-increment.d.ts +0 -5
- package/dist/src/rules/markdown/heading-start-left.d.ts +0 -5
- package/dist/src/rules/markdown/heading-style.d.ts +0 -5
- package/dist/src/rules/markdown/hr-style.d.ts +0 -5
- package/dist/src/rules/markdown/line-length.d.ts +0 -5
- package/dist/src/rules/markdown/link-fragments.d.ts +0 -5
- package/dist/src/rules/markdown/link-image-reference-definitions.d.ts +0 -5
- package/dist/src/rules/markdown/link-image-style.d.ts +0 -5
- package/dist/src/rules/markdown/list-indent.d.ts +0 -5
- package/dist/src/rules/markdown/list-marker-space.d.ts +0 -5
- package/dist/src/rules/markdown/no-alt-text.d.ts +0 -5
- package/dist/src/rules/markdown/no-bare-urls.d.ts +0 -5
- package/dist/src/rules/markdown/no-blanks-blockquote.d.ts +0 -5
- package/dist/src/rules/markdown/no-duplicate-heading.d.ts +0 -10
- package/dist/src/rules/markdown/no-emphasis-as-heading.d.ts +0 -9
- package/dist/src/rules/markdown/no-empty-links.d.ts +0 -5
- package/dist/src/rules/markdown/no-hard-tabs.d.ts +0 -5
- package/dist/src/rules/markdown/no-inline-html.d.ts +0 -5
- package/dist/src/rules/markdown/no-missing-space-atx.d.ts +0 -5
- package/dist/src/rules/markdown/no-missing-space-closed-atx.d.ts +0 -5
- package/dist/src/rules/markdown/no-multiple-blanks.d.ts +0 -5
- package/dist/src/rules/markdown/no-multiple-space-atx.d.ts +0 -5
- package/dist/src/rules/markdown/no-multiple-space-blockquote.d.ts +0 -5
- package/dist/src/rules/markdown/no-multiple-space-closed-atx.d.ts +0 -5
- package/dist/src/rules/markdown/no-reversed-links.d.ts +0 -5
- package/dist/src/rules/markdown/no-space-in-code.d.ts +0 -5
- package/dist/src/rules/markdown/no-space-in-emphasis.d.ts +0 -5
- package/dist/src/rules/markdown/no-space-in-links.d.ts +0 -5
- package/dist/src/rules/markdown/no-trailing-punctuation.d.ts +0 -5
- package/dist/src/rules/markdown/no-trailing-spaces.d.ts +0 -5
- package/dist/src/rules/markdown/ol-prefix.d.ts +0 -5
- package/dist/src/rules/markdown/proper-names.d.ts +0 -5
- package/dist/src/rules/markdown/reference-links-images.d.ts +0 -14
- package/dist/src/rules/markdown/required-headings.d.ts +0 -5
- package/dist/src/rules/markdown/single-title.d.ts +0 -5
- package/dist/src/rules/markdown/single-trailing-newline.d.ts +0 -5
- package/dist/src/rules/markdown/strong-style.d.ts +0 -16
- package/dist/src/rules/markdown/table-column-count.d.ts +0 -5
- package/dist/src/rules/markdown/table-column-style.d.ts +0 -5
- package/dist/src/rules/markdown/table-pipe-style.d.ts +0 -5
- package/dist/src/rules/markdown/ul-indent.d.ts +0 -14
- package/dist/src/rules/markdown/ul-style.d.ts +0 -5
- package/dist/src/rules/shell/command-substitution.d.ts +0 -6
- package/dist/src/rules/shell/consistent-case-terminators.d.ts +0 -9
- package/dist/src/rules/shell/function-style.d.ts +0 -6
- package/dist/src/rules/shell/heredoc-indent.d.ts +0 -7
- package/dist/src/rules/shell/indent.d.ts +0 -2
- package/dist/src/rules/shell/keyword-spacing.d.ts +0 -10
- package/dist/src/rules/shell/no-broken-redirect.d.ts +0 -7
- package/dist/src/rules/shell/no-cd-without-check.d.ts +0 -6
- package/dist/src/rules/shell/no-eval.d.ts +0 -6
- package/dist/src/rules/shell/no-exit-in-subshell.d.ts +0 -7
- package/dist/src/rules/shell/no-ls-parsing.d.ts +0 -7
- package/dist/src/rules/shell/no-trailing-semicolons.d.ts +0 -6
- package/dist/src/rules/shell/no-trailing-whitespace.d.ts +0 -5
- package/dist/src/rules/shell/no-useless-cat.d.ts +0 -6
- package/dist/src/rules/shell/no-variable-in-single-quotes.d.ts +0 -7
- package/dist/src/rules/shell/operator-spacing.d.ts +0 -11
- package/dist/src/rules/shell/prefer-double-brackets.d.ts +0 -6
- package/dist/src/rules/shell/prefer-printf.d.ts +0 -6
- package/dist/src/rules/shell/quote-variables.d.ts +0 -2
- package/dist/src/rules/shell/set-options.d.ts +0 -8
- package/dist/src/rules/shell/shebang.d.ts +0 -2
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{i}from"./chunk-yvrap76h.js";import{readdirSync as Ye,readFileSync as Xe}from"fs";import{homedir as Qe}from"os";import{join as le}from"path";var Ce=["code-style","lint"],a={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},Ve=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"]),Ze=/^\.?(?:pickier|code-style|lint|config)(?:\.(?:pickier|code-style|lint|config))*\.(?:ts|js|mjs|cjs|mts|cts|json|jsonc)$/i,et=new Set(["pickier",...Ce]);function tt(e){for(let w of Object.keys(process.env))if(w.startsWith("PICKIER_")&&!Ve.has(w))return!0;let c=Qe(),n=[e,le(e,"config"),le(e,".config"),le(c,".config","pickier"),le(c,".config"),c];for(let w of n){let b;try{b=Ye(w,{withFileTypes:!0})}catch{continue}for(let x of b){if(x.isDirectory())continue;if(Ze.test(x.name))return!0}}let s;try{s=Xe(le(e,"package.json"),"utf8")}catch{return!1}try{let w=JSON.parse(s);return w!==null&&typeof w==="object"&&Object.keys(w).some((b)=>et.has(b))}catch{return!0}}var ue=null;async function J(){if(!ue)if(!tt(process.cwd()))ue=a;else{let{loadConfig:e}=await import("./chunk-zp6n036m.js");ue=await e({name:"pickier",alias:[...Ce],defaultConfig:a})}return ue}var B=a;var nt=new Set([".ts",".js"]),rt=new Set([".json",".jsonc"]),st=new Set([".yaml",".yml"]),it=new Set([".sh",".bash",".zsh",".ksh",".dash"]),ot=new Set([".md",".mdx",".markdown"]),at=/^#!\s*(?:\/usr\/bin\/env\s+)?(?:ba|z|k|da)?sh\b/;var lt=/^[}\])]/,ct=/\s*\/\/.*$/,ft=/^(?:if|else\s+if|for|while)\s*\(/,ut=/^(?:\.[\w$[]|\?[\s.:]|:\s|&&|\|\|)/;function pt(e){let c=e.charCodeAt(0);if(c!==105&&c!==101&&c!==102&&c!==119&&c!==100)return!1;let n=ft.exec(e);if(!n)return/^(?:else|do)\s*$/.test(e);let s=0,w=null;for(let b=n[0].length-1;b<e.length;b++){let x=e[b];if(w){if(x==="\\"){b++;continue}if(x===w)w=null;continue}if(x==="'"||x==='"'||x==="`"){w=x;continue}if(x==="(")s++;else if(x===")"){if(s--,s===0)return e.slice(b+1).trim().length===0}}return!1}var dt=/^\s*for\s*\(/,mt=new RegExp("^\\s*;\\s*$"),gt=new RegExp(";{2,}\\s*$"),ht=/([\w)])\{/g,yt=/\{(return|if|for|while|switch|const|let|var|function)\b/g,wt=/,(\S)/g,bt=/(?<![=!<>+\-*/%&|^?])=(?![=><])/g,kt=/(\w)\+(\w)/g,Ct=/(\w)-(\w)/g,xt=/(\w)\*(\w)/g,Et=/(\w)\/(\w)/g,St=new RegExp("(?<=\\S);([^\\s;])","g"),_t=/([\w)\]])<(\d)/g,Rt=/([\w)\]])>(\d)/g,xe=/\s{2,}/g,Ee=/^\s*$/,It=/^\s*\/\//,Se=/^\s*\/\*/,Ot=/^\s*import\b/,_e=/\bfrom\s*['"][^'"]+['"]|^\s*import\s+['"][^'"]+['"]/,vt=/package\.json$/i,At=/[jt]sconfig(?:\..+)?\.json$/i,oe=/[ \t]+$/,Tt=/^\n+/;function fe(e){let c=e.lastIndexOf(".");return c>=0?e.slice(c):""}function pe(e){return nt.has(fe(e))}function Nt(e){return rt.has(fe(e))}function Pt(e){return st.has(fe(e))}function $t(e){return ot.has(fe(e))}function Mt(e){return it.has(fe(e))}function Lt(e,c){return Mt(e)||at.test(c)}function jt(e,c){let n=e.split(`
|
|
3
|
+
`),s=n.length,w=Array(s),b=c.format.indent,x=c.format.indentStyle==="tabs",_=0,v=!1,N="",A=!1,T=0;for(let j=0;j<s;j++){let F=n[j];if(F.length===0||/^\s*$/.test(F)){w[j]="";continue}if(v){if(w[j]=F,F.trim()===N)v=!1,N="";continue}let W=i(F);if(W)v=!0,N=W;let re=0;while(re<F.length&&(F.charCodeAt(re)===32||F.charCodeAt(re)===9))re++;let D=F.slice(re).trimEnd();if(D.startsWith("#")&&j>0){let O=x?"\t".repeat(_):" ".repeat(_*b);w[j]=O+D;continue}if(/^case\b/.test(D)&&/\bin\s*$/.test(D))T++,A=!0;if(/^esac\b/.test(D)){if(T=Math.max(0,T-1),T===0)A=!1}let ne=A&&/\)\s*$/.test(D)&&!/\$\(/.test(D)&&!/^\s*\(/.test(D)&&!D.startsWith("#"),ee=/^;[;&]\s*$/.test(D);if(/^(?:fi|done|esac|elif|else)\b/.test(D)||/^\}/.test(D))_=Math.max(0,_-1);if(ee)_=Math.max(0,_-1);let ie=x?"\t".repeat(_):" ".repeat(_*b);if(w[j]=ie+D,/^then\b/.test(D)||/^do\b/.test(D)||/^else\b/.test(D))_++;else if(/^if\b/.test(D)&&/\bthen\s*$/.test(D))_++;else if(/^elif\b/.test(D)&&/\bthen\s*$/.test(D))_++;else if(/^(?:while|for|until)\b/.test(D)&&/\bdo\s*$/.test(D))_++;else if(/^case\b/.test(D)&&/\bin\s*$/.test(D))_++;else if(ne)_++;else if(/\{\s*$/.test(D)&&!D.startsWith("#"))_++}return w.join(`
|
|
4
|
+
`)}function Ft(e,c){try{let n=Bun.YAML.parse(e),s=c.format.indentStyle==="tabs"?"\t":c.format.indent;return Bun.YAML.stringify(n,null,s).split(`
|
|
5
|
+
`).map((b)=>b.replace(/[ \t]+$/,"")).join(`
|
|
6
|
+
`)}catch{return e}}var Re=Array.from({length:129},(e,c)=>" ".repeat(c));function Dt(e){if(e<=0)return"";return e<Re.length?Re[e]:" ".repeat(e)}function Wt(e,c){if((c.format.indentStyle||"spaces")==="tabs")return"\t".repeat(Math.max(0,e));return Dt(Math.max(0,e*c.format.indent))}function Ut(e){return`'${e.slice(1,-1).replace(/\\"/g,'"')}'`}function Gt(e){return`"${e.slice(1,-1).replace(/\\'/g,"'")}"`}function Kt(e,c){for(let n=0;n<e.length;n++){if(e[n]==="\\"){n++;continue}if(e[n]===c)return!0}return!1}function Bt(e,c,n){if(!pe(n))return e;let s=e.split(`
|
|
7
|
+
`);for(let w=0;w<s.length;w++)s[w]=$e(s[w],c);return s.join(`
|
|
8
|
+
`)}function $e(e,c){let n=c==="single";if(n?!e.includes('"'):!e.includes("'"))return e;let s=[],w=0,b=0,x=0,_=0;while(w<e.length){let v=e[w];if(x===0){if(v==="/"){let N=e[w+1];if(N==="/")break;if(N==="*"){let A=e.indexOf("*/",w+2);w=A===-1?e.length:A+2;continue}if(Ke(e,w)){let A=Be(e,w);if(A!==-1){w=A;continue}}w++;continue}if(v==='"'){x=2,_=w,w++;continue}if(v==="'"){x=1,_=w,w++;continue}if(v==="`"){x=3,w++;continue}w++}else if(x===3){if(v==="\\"){w+=2;continue}if(v==="`")x=0;w++}else{if(v==="\\"){w+=2;continue}if(v===(x===1?"'":'"')){let A=e.slice(_+1,w);if((x===2&&n||x===1&&!n)&&!Kt(A,n?"'":'"')){if(_>b)s.push(e.slice(b,_));if(x===2)s.push(Ut(`"${A}"`));else s.push(Gt(`'${A}'`));b=w+1}x=0,w++;continue}w++}}if(s.length===0)return e;if(b<e.length)s.push(e.slice(b));return s.join("")}function zt(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 Ht(e,c){let n=!1;for(let s=c;s<e.length;s++){let w=e.charCodeAt(s),b=w===32||w>=9&&w<=13||w>=128&&Jt.test(e[s]);if(b&&n)return!0;n=b}return!1}var Me=1,Le=2,je=4,Fe=8,De=16,We=32;function he(e){return e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57||e===95}function qt(e){let c=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(he(e.charCodeAt(n-1))&&he(e.charCodeAt(n+1)))c|=s===43?Me:s===45?Le:s===42?je:Fe}else if(s===60||s===62){let w=e.charCodeAt(n+1),b=e.charCodeAt(n-1);if(w>=48&&w<=57&&(he(b)||b===41||b===93))c|=s===60?De:We}}return c}function Yt(e,c){if(c+e.length<4)return e;let n=0;while(n<e.length&&(e[n]===" "||e[n]==="\t"))n++;if(n<e.length){let v=e[n];if(v==="/"&&(e[n+1]==="/"||e[n+1]==="*"))return e;if(v==="*")return e}let s=!1;for(let v=n;v<e.length;v++)if(zt(e.charCodeAt(v))){s=!0;break}if(!s)return e;let{text:w,strings:b}=en(e),x=w;if(x.includes("{"))x=x.replace(ht,"$1 {"),x=x.replace(yt,"{ $1");if(x.includes(","))x=x.replace(wt,", $1");if(x.includes("="))x=x.replace(bt," = ");let _=qt(x);if(_&Me)x=x.replace(kt,"$1 + $2");if(_&Le)x=x.replace(Ct,"$1 - $2");if(_&je)x=x.replace(xt,"$1 * $2");if(_&Fe)x=x.replace(Et,"$1 / $2");if(x.includes(";"))x=x.replace(St,"; $1");if(_&De)x=x.replace(_t,"$1 < $2");if(_&We)x=x.replace(Rt,"$1 > $2");if(Ht(x,n))if(n>0){let v=x.slice(n);x=x.slice(0,n)+v.replace(xe," ")}else x=x.replace(xe," ");return b.length>0?tn(x,b):x}function de(e){let c=e[e.length-1];return c!==void 0&&c.t==="tmpl"}function Ue(e,c,n){c++;while(c<e.length){let s=e[c];if(s==="\\"){c+=2;continue}if(s===n)return c+1;c++}return c}function ye(e,c){for(let s of c)if(s.t==="tmpl")s.start=-1;let n=0;while(n<e.length){let s=c[c.length-1],w=e[n];if(s===void 0||s.t==="interp"){if(w==="`"){c.push({t:"tmpl",start:n}),n++;continue}if(w==="'"||w==='"'){n=Ue(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)c.pop();else s.braces--;n++;continue}}n++}else{if(w==="\\"){n+=2;continue}if(w==="`"){c.pop(),n++;continue}if(w==="$"&&e[n+1]==="{"){c.push({t:"interp",braces:0}),n+=2;continue}n++}}if(de(c)){for(let s of c)if(s.t==="tmpl"&&s.start>=0)return s.start}return-1}function Ie(e,c){let n=c,s=null,w=0;while(w<e.length){let b=e[w];if(n){if(b==="*"&&e[w+1]==="/"){n=!1,w+=2;continue}w++;continue}if(s){if(b==="\\"){w+=2;continue}if(b===s)s=null;w++;continue}if(b==="'"||b==='"'||b==="`"){s=b,w++;continue}if(b==="/"){if(e[w+1]==="/")break;if(e[w+1]==="*"){n=!0,w+=2;continue}}w++}return n}function Oe(e,c){let n=e.length,s=Array(n),w=c.format.quotes,b=c.format.semi===!0,x=0,_=0,v=!1,N=[];for(let A=0;A<n;A++){let T=e[A];if(v){v=Ie(T,!0),s[A]=T;continue}let j=de(N),F=-1;if(N.length>0||T.indexOf("`")!==-1)F=ye(T,N);if(j){s[A]=T;continue}if(F<0&&N.length===0)v=T.includes("/*")&&Ie(T,!1);let W="",re=!1,D="";if(F>=0){W=T.slice(F);let H=T.slice(0,F);if(H.length===0){s[A]=W;continue}if(re=oe.test(H),H.trim().length===0)D=H;T=H}if(T.length===0){s[A]="";continue}T=$e(T,w);let ne=0;while(ne<T.length&&(T.charCodeAt(ne)===32||T.charCodeAt(ne)===9))ne++;let ee=T.slice(ne).trimEnd();if(lt.test(ee))x=Math.max(0,x-1);let ae=ut.test(ee)?1:0,ie=c.format.preserveCodeIndentation?T.slice(0,ne):Wt(x+_+ae,c),O=ee.charCodeAt(ee.length-1);if(O===123||O===91||O===40)x+=1,_=0;else if(!ee.startsWith("//")&&!ee.startsWith("*")&&!ee.startsWith("/*")){let H=ee.includes("//")?ee.replace(ct,""):ee;_=pt(H)?_+1:0}let I=Yt(ee,ie.length),te=!1;if(b){if(!dt.test(I))if(mt.test(I))te=!0;else I=I.replace(gt,";")}if(te)T="";else if(c.format.trimTrailingWhitespace)I=I.trimEnd(),T=I.length===0?"":ie+I;else T=ie+I;if(F>=0){if(D)T=D;else if(re&&!oe.test(T))T+=" ";T+=W}s[A]=T}return s}var ve=/^[ \t]*(`{3,}|~{3,})(.*)$/,Xt=/^ {0,3}#{1,6}(?:[ \t]|$)/;function Qt(e,c){let n=c.format.trimTrailingWhitespace,s=Math.max(0,c.format.maxConsecutiveBlankLines),w=[],b=0,x="",_=0;for(let v=0;v<e.length;v++){let N=e[v];if(x!==""){let W=N.indexOf(x)!==-1?ve.exec(N):null;if(W&&W[1][0]===x&&W[1].length>=_&&W[2].trim()==="")x="",w.push(n?N.replace(oe,""):N);else w.push(N);continue}if(N.length===0||N.trim()===""){if(b++,b<=s)w.push("");continue}if(b=0,N.indexOf("```")!==-1||N.indexOf("~~~")!==-1){let W=ve.exec(N);if(W&&!(W[1][0]==="`"&&W[2].includes("`"))){x=W[1][0],_=W[1].length,w.push(n?N.replace(oe,""):N);continue}}let A=N.charCodeAt(N.length-1);if(!n||A!==32&&A!==9){w.push(N);continue}let T=N.replace(oe,""),j=e[v+1],F=N.endsWith(" ")&&j!==void 0&&j.trim()!==""&&!Xt.test(N);w.push(F?`${T} `:T)}return w}function Vt(e,c){let n=[],s=0,w=[];for(let b of e){let x=de(w);if(w.length>0||b.indexOf("`")!==-1)ye(b,w);if(x){n.push(b),s=0;continue}if(b===""){if(s++,s<=c)n.push("")}else s=0,n.push(b)}return n}function d(e,c,n){if(e.length===0)return"";let w=(e.includes("\r")?e.replace(/\r\n/g,`
|
|
9
|
+
`):e).split(`
|
|
10
|
+
`),b;if($t(n))b=Qt(w,c);else if(c.format.trimTrailingWhitespace){b=[];let _=0,v=Math.max(0,c.format.maxConsecutiveBlankLines),N=[];for(let A of w){let T=de(N),j=!1;if(N.length>0||A.indexOf("`")!==-1)j=ye(A,N)>=0;if(T||j){b.push(A),_=0;continue}let F=A[A.length-1],W=F===" "||F==="\t"?A.replace(oe,""):A;if(W===""){if(_++,_<=v)b.push("")}else _=0,b.push(W)}}else b=Vt(w,Math.max(0,c.format.maxConsecutiveBlankLines));let x;if(pe(n)&&!(b.length>0&&b[0].startsWith("#!"))){let _=0;while(_<b.length&&b[_]==="")_++;if(_>0)b=b.slice(_);return b=ze(b)??b,x=Oe(b,c).join(`
|
|
11
|
+
`),Ae(x,c)}if(x=b.join(`
|
|
12
|
+
`),x=x.replace(Tt,""),pe(n))x=k(x);if(Pt(n)){let _=Ft(x,c);if(_!==x)x=_}if(Nt(n)){let _=on(x,n);if(_!=null)x=_}if(Lt(n,x))x=jt(x,c);else if(pe(n))x=Oe(x.split(`
|
|
13
|
+
`),c).join(`
|
|
14
|
+
`);else x=Bt(x,c.format.quotes,n);return Ae(x,c)}function Ae(e,c){let n=e.length;while(n>0&&e.charCodeAt(n-1)===10)n--;if(c.format.finalNewline==="none")return n===e.length?e:e.slice(0,n);let s=c.format.finalNewline==="two"?`
|
|
15
|
+
|
|
16
|
+
`:`
|
|
17
|
+
`;if(e.length-n===s.length)return e;return e.slice(0,n)+s}function Te(e,c,n,s){for(let w=c+1;w<e.length;w++){let b=e[w];if(b==="\\"){w++;continue}if(b===n)return!0;if(b===s)return!1}return!0}function S(e,c){if(/^\s*\/\/\/\s*<reference/.test(e))return[];let n=[],s=null,w=!1;for(let b=0;b<e.length;b++){let x=e[b];if(w){w=!1;continue}if(x==="\\"){w=!0;continue}if(!s){if(x==="/"&&e[b+1]==="/")break;if(x==="'"){if(c==="double"&&Te(e,b,"'",'"'))n.push(b);s="single";continue}else if(x==='"'){if(c==="single"&&Te(e,b,'"',"'"))n.push(b);s="double";continue}else if(x==="`"){s="template";continue}}else if(s==="single"&&x==="'"||s==="double"&&x==='"'||s==="template"&&x==="`"){s=null;continue}}return n}function C(e,c,n="spaces",s){if(n==="tabs")return/[^\t]/.test(e);if(/\t/.test(e))return!0;let w=e.length;if(s&&w%c===1){let b=s.trimStart();if(b.startsWith("* ")||b.startsWith("*/")||b==="*")return!1}return w%c!==0}function Ge(e,c){let n=c+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 b=e[n];if(b==="\\"){n+=2;continue}if(b==="`"){n=Ge(e,n);continue}if(b==="'"||b==='"'){n=Ue(e,n,b);continue}if(b==="{")w++;else if(b==="}")w--;n++}continue}n++}return n}var Zt=new Set(["return","typeof","instanceof","in","of","new","delete","void","do","else","case","yield","await"]);function Ke(e,c){let n=c-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 Zt.has(e.slice(w+1,n+1))}return!1}function Be(e,c){let n=c+1,s=!1,w=-1;while(n<e.length){let b=e[n];if(b==="\\"){n+=2;continue}if(b==="["&&!s)s=!0,w=n;else if(b==="]"&&s){let x=e[w+1]==="^"?w+2:w+1;if(n!==x)s=!1}else if(b==="/"&&!s){n++;while(n<e.length&&/[a-z]/i.test(e[n]))n++;return n}n++}return-1}function en(e){if(!e.includes("'")&&!e.includes('"')&&!e.includes("`")&&!e.includes("/"))return{text:e,strings:[]};let c=[],n=[],s=0,w=0;while(s<e.length){let b=e[s];if(b==="/"){let x=e[s+1];if(x==="/"){if(s>w)n.push(e.slice(w,s));c.push(e.slice(s)),n.push(`@@S${c.length-1}@@`),w=e.length;break}if(x==="*"){let _=e.indexOf("*/",s+2),v=_===-1?e.length:_+2;if(s>w)n.push(e.slice(w,s));c.push(e.slice(s,v)),n.push(`@@S${c.length-1}@@`),s=v,w=s;continue}if(Ke(e,s)){let _=Be(e,s);if(_!==-1){if(s>w)n.push(e.slice(w,s));c.push(e.slice(s,_)),n.push(`@@S${c.length-1}@@`),s=_,w=s;continue}}s++;continue}if(b==="'"||b==='"'||b==="`"){if(s>w)n.push(e.slice(w,s));let x=s;if(b==="`")s=Ge(e,s);else{let _=b;s++;while(s<e.length){if(e[s]==="\\"){s+=2;continue}if(e[s]===_){s++;break}s++}}c.push(e.slice(x,s)),n.push(`@@S${c.length-1}@@`),w=s;continue}s++}if(w<e.length)n.push(e.slice(w));return{text:n.join(""),strings:c}}function tn(e,c){if(c.length===0)return e;let n="",s=0,w=e.indexOf("@@S");while(w!==-1){let b=w+3;while(b<e.length&&e.charCodeAt(b)>=48&&e.charCodeAt(b)<=57)b++;if(b>w+3&&e.charCodeAt(b)===64&&e.charCodeAt(b+1)===64)n+=e.slice(s,w)+(c[Number(e.slice(w+3,b))]??""),s=b+2,w=e.indexOf("@@S",s);else w=e.indexOf("@@S",w+1)}return s===0?e:n+e.slice(s)}function Ne(e){return e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57||e===95||e===36}function nn(e,c){let n=0;while(!0){let s=e.indexOf(c,n);if(s===-1)return!1;if(n=s+1,Ne(e.charCodeAt(s+c.length)))continue;let w=s-1,b=!0;while(w>=0){let x=e.charCodeAt(w);if(!Ne(x))break;if(x<48||x>57){b=!1;break}w--}if(b)return!0}}function k(e){let c=e[0];if(c!=="i"&&c!==" "&&c!=="\t"&&c!=="/"&&c!==`
|
|
18
|
+
`)return e;let n=ze(e.split(`
|
|
19
|
+
`));return n===null?e:n.join(`
|
|
20
|
+
`)}function ze(e){let c=e.length===0?void 0:e[0].length>0?e[0][0]:e.length>1?`
|
|
21
|
+
`:void 0;if(c!=="i"&&c!==" "&&c!=="\t"&&c!=="/"&&c!==`
|
|
22
|
+
`)return null;let n=[],s=[],w=[],b=0,x=0,_=-1,v=!1;while(b<e.length){let O=e[b];if(Ee.test(O)){b++;continue}if(It.test(O)||Se.test(O)){let Q=b;if(Se.test(O)){while(b<e.length&&!e[b].includes("*/"))b++;b++}else b++;if(!v){for(let se=Q;se<b&&se<e.length;se++)s.push(e[se]);x=b}else if(_<0)_=Q;continue}if(!Ot.test(O))break;let I=O.trim(),te=b+1;while(!_e.test(I)&&te<e.length&&te-b<50)I+=` ${e[te].trim()}`,te++;if(!_e.test(I))return null;let H=sn(I);if(!H)return null;if(_>=0){for(let Q=_;Q<b;Q++)if(!Ee.test(e[Q]))w.push(e[Q]);_=-1}n.push(H),b=te,x=b,v=!0}if(n.length===0)return null;let N=_>=0?_:x,A=e.slice(N),T=0;while(T<A.length&&A[T]==="")T++;let j=T===0?A:A.slice(T),F=new Map,W=(O)=>{let I=F.get(O);if(I===void 0){I=!1;for(let te of A)if(nn(te,O)){I=!0;break}F.set(O,I)}return I};for(let O of n){if(O.kind!=="value")continue;O.named=O.named.filter((I)=>{if(I.alias)return!0;return W(I.name)})}let re=n.filter((O)=>{if(O.kind==="side-effect")return!0;if(O.kind==="type")return O.namedTypes.length>0;return Boolean(O.defaultName||O.namespaceName||O.named.length>0)}),D=new Map;for(let O of re){let I=D.get(O.source)||{};if(O.kind==="side-effect")I.side=I.side||[],I.side.push(O);else if(O.kind==="type"){if(!I.type)I.type={kind:"type",source:O.source,named:[],namedTypes:[],original:""};I.type.namedTypes=(I.type.namedTypes||[]).concat(O.namedTypes)}else{if(!I.value)I.value={kind:"value",source:O.source,named:[],namedTypes:[],original:""};if(O.defaultName)I.value.defaultName=O.defaultName;if(O.namespaceName)I.value.namespaceName=O.namespaceName;if(I.value.named=(I.value.named||[]).concat(O.named),O.namedTypes.length>0){if(!I.type)I.type={kind:"type",source:O.source,named:[],namedTypes:[],original:""};I.type.namedTypes=I.type.namedTypes.concat(O.namedTypes)}}D.set(O.source,I)}let ne=[];for(let[O,I]of D){if(I.side)ne.push(...I.side);if(I.value){let te=(H)=>{if(!H.alias)return H;return/^[A-Z]$/i.test(H.name)&&/^[A-Z]$/i.test(H.alias)?{name:H.alias,alias:H.name}:H};I.value.named=I.value.named.map(te),I.value.named.sort((H,Q)=>H.name.localeCompare(Q.name)),ne.push(I.value)}if(I.type&&I.type.namedTypes.length>0){let te=new Set,H=(Q)=>{if(!Q.alias)return Q;return/^[A-Z]$/i.test(Q.name)&&/^[A-Z]$/i.test(Q.alias)?{name:Q.alias,alias:Q.name}:Q};I.type.namedTypes=I.type.namedTypes.map(H).filter((Q)=>{let se=`${Q.name}|${Q.alias||""}`;if(te.has(se))return!1;return te.add(se),!0}),I.type.namedTypes.sort((Q,se)=>Q.name.localeCompare(se.name)),ne.push(I.type)}}let ee=(O)=>O.startsWith(".")?2:O.startsWith("node:")?0:1,ae=(O)=>{if(O.kind!=="value")return 99;if(O.defaultName)return 0;if(O.namespaceName)return 1;return 2};if(ne.sort((O,I)=>{if(O.kind!==I.kind){if(O.kind==="type")return-1;if(I.kind==="type")return 1;if(O.kind==="side-effect")return-1;if(I.kind==="side-effect")return 1}if(O.kind==="type"&&I.kind==="type"){let te=ee(O.source),H=ee(I.source);if(te!==H)return te-H;return O.source.localeCompare(I.source)}if(O.kind==="value"&&I.kind==="value"){let te=ee(O.source),H=ee(I.source);if(te!==H)return te-H;let Q=ae(O),se=ae(I);if(Q!==se)return Q-se;return O.source.localeCompare(I.source)}return O.source.localeCompare(I.source)}),ne.length===0){if(s.length>0||w.length>0)return[...s,...w,...j.length>0?j:[""]];return j}let ie=[...s];for(let O of ne){let I=rn(O);if(I.includes(`
|
|
23
|
+
`))ie.push(...I.split(`
|
|
24
|
+
`));else ie.push(I)}return ie.push(...w),ie.push(""),ie.push(...j),ie}function rn(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 c=[];if(e.defaultName)c.push(e.defaultName);if(e.namespaceName)c.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(", ");c.push(`{ ${s} }`)}return`import ${c.join(", ")} from '${e.source}'`}function sn(e){let c=e.match(/^\s*import\s+['"]([^'"]+)['"]/);if(c)return{kind:"side-effect",source:c[1],named:[],namedTypes:[],original:e};if(c=e.match(/^\s*import\s+type\s+\{([^}]*)\}\s+from\s+['"]([^'"]+)['"]/),c){let j=c[1],F=c[2],W=j.split(",").map((re)=>re.trim()).filter(Boolean).map((re)=>{let D=re.match(/^(\w+)(?:\s+as\s+(\w+))?$/);return{name:D?.[1]||re,alias:D?.[2]}});return{kind:"type",source:F,named:[],namedTypes:W,original:e}}let n=e.match(/^\s*import\s+/),s=new RegExp(`\\sfrom\\s+['"]([^'"]+)['"]\\s*;?$`),w=e.match(s);if(!n||!w)return;let b=w[1],x=e.slice(n[0].length,w.index).trim(),_,v,N=[],A=[],T=x.match(/\{([^}]*)\}/);if(T){let F=T[1].split(",").map((W)=>W.trim()).filter(Boolean);for(let W of F){let re=/^type\s+/.test(W),ne=W.replace(/^type\s+/,"").match(/^(\w+)(?:\s+as\s+(\w+))?$/);if(!ne)continue;let ee={name:ne[1],alias:ne[2]};if(re)A.push(ee);else N.push(ee)}x=x.replace(/\{[\s\S]*?\}/,"").trim()}if(x.length>0){let j=x.split(",").map((F)=>F.trim()).filter(Boolean);for(let F of j)if(F.startsWith("* as "))v=F.slice(5).trim();else if(/^\w+$/.test(F))_=F}return{kind:"value",source:b,defaultName:_,namespaceName:v,named:N,namedTypes:A,original:e}}function on(e,c){if(vt.test(c))return an(e);if(At.test(c))return ln(e);return null}function Je(e){try{return JSON.parse(e)}catch{return null}}function ce(e,c,n=[]){let s={};for(let b of c)if(Object.prototype.hasOwnProperty.call(e,b))s[b]=e[b];for(let b of n){let x=Object.keys(e).filter((_)=>b.test(_)&&!(_ in s)).sort();for(let _ of x)s[_]=e[_]}let w=Object.keys(e).filter((b)=>!(b in s)).sort();for(let b of w)s[b]=e[b];return s}function Pe(e){let c={};for(let n of Object.keys(e).sort())c[n]=e[n];return c}function an(e){let c=Je(e);if(!c||typeof c!=="object")return e;let s=ce(c,["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((x)=>typeof x==="string"))s.files=[...s.files].sort()}for(let b of Object.keys(s))if(/^(?:dev|peer|optional|bundled)?[Dd]ependencies(?:Meta)?$/.test(b)||/^(?:resolutions|overrides|pnpm\.overrides)$/.test(b)){if(s[b]&&typeof s[b]==="object")s[b]=Pe(s[b])}if(s.pnpm&&typeof s.pnpm==="object"&&s.pnpm.overrides&&typeof s.pnpm.overrides==="object")s.pnpm.overrides=Pe(s.pnpm.overrides);if(s.exports&&typeof s.exports==="object"){let b=s.exports,x=["types","import","require","default"];if(!Array.isArray(b)){let _={};for(let v of Object.keys(b)){let N=b[v];if(N&&typeof N==="object"&&!Array.isArray(N))_[v]=ce(N,x);else _[v]=N}s.exports=_}}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 b of["gitHooks","husky","simple-git-hooks"])if(s[b]&&typeof s[b]==="object")s[b]=ce(s[b],w);return JSON.stringify(s,null,2)}function ln(e){let c=Je(e);if(!c||typeof c!=="object")return e;let s=ce(c,["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=ce(s.compilerOptions,w)}return JSON.stringify(s,null,2)}import{readdirSync as cn,readFileSync as fn,statSync as be}from"fs";import{extname as un,isAbsolute as me,join as ge,resolve as pn}from"path";var E=5;function dn(e){let c="",n=0;while(n<e.length){let s=e[n];if(s==="*")if(e[n+1]==="*"){if(c+=".*",n+=2,e[n]==="/")n++}else c+="[^/]*",n++;else if(s==="?")c+="[^/]",n++;else if(s==="["){let w=e.indexOf("]",n);if(w===-1)c+="\\[",n++;else c+=e.slice(n,w+1),n=w+1}else if(".+^${}()|\\".includes(s))c+=`\\${s}`,n++;else c+=s,n++}return new RegExp(`^${c}$`)}function*qe(e,c,n){let s;try{s=cn(e)}catch{return}for(let w of s){if(!n&&w.startsWith("."))continue;let b=ge(e,w);if(c(b))continue;let x;try{x=be(b)}catch{continue}if(x.isDirectory())yield*qe(b,c,n);else yield b}}function*He(e,c,n,s){yield*qe(e,h(c,s),n)}async function u(e,c={}){let n=c.cwd??process.cwd(),s=c.ignore??[],w=c.dot??!1,b=c.absolute??!0,x=h(s,n);if(typeof globalThis.Bun?.Glob<"u"){let v=globalThis.Bun.Glob,N=[];for(let A of e){if(!/[*?[{]/.test(A)){let j=me(A)?A:ge(n,A);if(be(j,{throwIfNoEntry:!1})?.isFile()){if(!x(j))N.push(b?j:j.startsWith(`${n}/`)?j.slice(n.length+1):j);continue}}let T=new v(A);for await(let j of T.scan({cwd:n,dot:w,onlyFiles:c.onlyFiles??!0,followSymlinks:!1})){let F=me(j)?j:ge(n,j),W=F.startsWith(`${n}/`)?F.slice(n.length+1):F;if(x(F))continue;N.push(b?F:W)}}return N}let _=[];for(let v of e){if(!/[*?[{]/.test(v)){let A=me(v)?v:ge(n,v);try{if(!be(A).isDirectory()){let j=A.startsWith(`${n}/`)?A.slice(n.length+1):A;if(!x(A))_.push(b?A:j)}else for(let j of He(A,s,w,n))_.push(b?j:j.startsWith(`${n}/`)?j.slice(n.length+1):j)}catch{}continue}let N=dn(v);for(let A of He(n,s,w,n)){let T=A.startsWith(`${n}/`)?A.slice(n.length+1):A;if(N.test(T)||N.test(T.replace(/\\/g,"/")))_.push(b?A:T)}}return _}function Y(e){let c=0,n=[],s=()=>{if(n.length>0&&c<e)c++,n.shift()()};return(w)=>new Promise((b,x)=>{let _=()=>{w().then((v)=>{c--,b(v),s()},(v)=>{c--,x(v),s()})};if(c<e)c++,_();else n.push(_)})}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 c=Number(e);return Number.isFinite(c)?Math.max(0,Math.floor(c)):null}},M=["**/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 L(e,c){let n=e[c];if(n===void 0){let b=c.indexOf("/");if(b>0){let x=c.slice(0,b),_=c.slice(b+1),v=x==="general"?"pickier":x==="pickier"?"general":null;if(v)n=e[`${v}/${_}`];if(n===void 0)n=e[_]}}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 b=n[0];if(b==="error")s="error";else if(b==="warn"||b==="warning")s="warning";w=n[1]}return{enabled:!!s,severity:s,options:w}}function R(e){let c=Array.isArray(e)?e[0]:e;if(typeof c!=="string")return;if(c==="off")return"off";if(c==="error")return"error";if(c==="warn"||c==="warning")return"warning";return}function o(e,c,n=[],s){for(let b of[c,...n]){let x=R(e.rules?.[b])??R(e.pluginRules?.[b]);if(x)return x==="off"?void 0:x}let w=R(s);return w==="off"?void 0:w}function Z(e,c){return R(e.rules?.[c])==="off"||R(e.pluginRules?.[c])==="off"}function g(e,c){return`\x1B[${e}m${c}\x1B[0m`}function U(e){return g("32",e)}function V(e){return g("31",e)}function K(e){return g("33",e)}function z(e){return g("34",e)}function q(e){return g("90",e)}function G(e){return g("1",e)}var t={green:U,red:V,yellow:K,blue:z,gray:q,bold:G};function p(e,c){let n=c.ignores?[...new Set([...e.ignores||[],...c.ignores])]:e.ignores,s={...e.pluginRules||{},...c.pluginRules||{}};if((c.tailwind??e.tailwind)?.enabled&&!Object.prototype.hasOwnProperty.call(s,"pickier/sort-tailwind-classes"))s["pickier/sort-tailwind-classes"]="warn";return{...e,...c,verbose:c.verbose??e.verbose,ignores:n,lint:{...e.lint,...c.lint||{}},format:{...e.format,...c.format||{}},rules:{...e.rules,...c.rules||{}},pluginRules:s}}var we=null;async function l(e){if(!e){if(r.NO_AUTO_CONFIG){if(!we)we=p(a,{});return we}try{let{getConfig:s}=await import("./chunk-w7q10fyj.js"),w=await s();return p(a,w)}catch{}return p(a,{})}let c=me(e)?e:pn(process.cwd(),e);if(un(c).toLowerCase()===".json")try{let s=fn(c,"utf8");return p(a,JSON.parse(s))}catch{return console.warn(`[pickier:warn] Config file not found: ${c}. Using default config values.`),p(a,{})}try{let s=await import(c);return p(a,s.default||s)}catch{return console.warn(`[pickier:warn] Config file not found: ${c}. Using default config values.`),p(a,{})}}function y(e){return e.map((c)=>{if(/[*?[\]{}()!]/.test(c))return c;if(/\.[A-Z0-9]+$/i.test(c))return c;return`${c.replace(/\/$/,"")}/**/*`})}function P(e,c){let n=e.lastIndexOf(".");if(n<0)return!1;let s=e.slice(n);return c.has(s)}function ke(e){if(!e.includes("\\")&&!e.includes("//"))return e;return e.replace(/\\/g,"/").replace(/\/+/g,"/")}function mn(e){let c=[];for(let n of e){let s=ke(n.trim());if(!s)continue;let w=s.match(/\*\*\/\*\.(.+)$/);if(w){c.push({raw:s,kind:"extension",value:w[1]});continue}let b=s.match(/\*\*\/(.+?)\/\*\*$/);if(b){c.push({raw:s,kind:"segment",value:b[1]});continue}let x=s.match(/\*\*\/(.+)$/);if(x)c.push({raw:s,kind:"suffix",value:x[1].replace(/\/$/,"")})}return c}function m(e){return[...new Set([...M,...e])]}function h(e,c=process.cwd()){let n=mn([...M,...e]);if(n.length===0)return()=>!1;let s=new Set([...f,...M]),w=ke(c).replace(/\/$/,""),b=`${w}/`,x=n.map((_)=>({pattern:_,universal:s.has(_.raw),suffix:_.kind==="extension"?`.${_.value}`:`/${_.value}`,inner:`/${_.value}/`}));return(_)=>{let v=ke(_),N=v!==w&&!v.startsWith(b),A=N?v:v.slice(w.length);for(let{pattern:T,universal:j,suffix:F,inner:W}of x){if(N&&!j)continue;if(T.kind==="extension"){if(A.endsWith(F))return!0;continue}if(T.kind==="segment"||T.kind==="suffix"){if(A.includes(W)||A.endsWith(F))return!0}}return!1}}function X(e,c){return h(c)(e)}
|
|
25
|
+
export{a,J,B,d,S,C,k,E,u,Y,r,M,f,L,R,o,Z,g,U,V,K,z,q,G,t,p,l,y,P,m,h,X};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
function c(e){let u=e.length,f=Array.from({length:u},(t,r)=>e[r]),n=0;while(n<u){let t=e[n];if(t==="#"&&(n===0||/\s/.test(e[n-1]))){while(n<u)f[n]=" ",n++;break}if(t==="$"&&e[n+1]==="'"){n+=2;while(n<u){if(e[n]==="\\"&&n+1<u){f[n]=" ",f[n+1]=" ",n+=2;continue}if(e[n]==="'"){n++;break}f[n]=" ",n++}continue}if(t==="$"&&e[n+1]==='"'){n++,n=h(e,n,f);continue}if(t==="$"&&e[n+1]==="{"){n+=2;let r=1;while(n<u&&r>0){let o=e[n];if(o==="\\"&&n+1<u){f[n]=" ",f[n+1]=" ",n+=2;continue}if(o==="'"){n++;while(n<u&&e[n]!=="'")f[n]=" ",n++;if(n<u)n++;continue}if(o==='"'){n=h(e,n,f);continue}if(o==="{"){r++,n++;continue}if(o==="}"){r--,n++;continue}f[n]=" ",n++}continue}if(t==="$"&&e[n+1]==="("&&e[n+2]==="("){n+=3;let r=2;while(n<u&&r>0){let o=e[n];if(o==="("){r++,n++;continue}if(o===")"){r--,n++;continue}f[n]=" ",n++}continue}if(t==="$"&&e[n+1]==="("){n+=2;let r=1;while(n<u&&r>0){let o=e[n];if(o==="\\"&&n+1<u){f[n]=" ",f[n+1]=" ",n+=2;continue}if(o==="'"){n++;while(n<u&&e[n]!=="'")f[n]=" ",n++;if(n<u)n++;continue}if(o==='"'){n=h(e,n,f);continue}if(o==="("){r++,n++;continue}if(o===")"){r--,n++;continue}f[n]=" ",n++}continue}if(t==="'"){n++;while(n<u&&e[n]!=="'")f[n]=" ",n++;if(n<u)n++;continue}if(t==='"'){n=h(e,n,f);continue}if(t==="`"){n++;while(n<u&&e[n]!=="`"){if(e[n]==="\\"&&n+1<u){f[n]=" ",f[n+1]=" ",n+=2;continue}f[n]=" ",n++}if(n<u)n++;continue}n++}return f.join("")}function h(e,u,f){let n=e.length,t=u+1;while(t<n){let r=e[t];if(r==="\\"&&t+1<n){f[t]=" ",f[t+1]=" ",t+=2;continue}if(r==='"')return t+1;if(r==="$"&&e[t+1]==="("&&e[t+2]==="("){t+=3;let o=2;while(t<n&&o>0){let s=e[t];if(s==="("){o++,t++;continue}if(s===")"){o--,t++;continue}f[t]=" ",t++}continue}if(r==="$"&&e[t+1]==="("){t+=2;let o=1;while(t<n&&o>0){let s=e[t];if(s==="\\"&&t+1<n){f[t]=" ",f[t+1]=" ",t+=2;continue}if(s==="'"){t++;while(t<n&&e[t]!=="'")f[t]=" ",t++;if(t<n)t++;continue}if(s==='"'){t=h(e,t,f);continue}if(s==="("){o++,t++;continue}if(s===")"){o--,t++;continue}f[t]=" ",t++}continue}if(r==="$"&&e[t+1]==="{"){t+=2;let o=1;while(t<n&&o>0){let s=e[t];if(s==="{"){o++,t++;continue}if(s==="}"){o--,t++;continue}f[t]=" ",t++}continue}f[t]=" ",t++}return t}function i(e){let f=c(e).match(/<<-?/);if(!f||f.index===void 0)return null;let t=e.slice(f.index+f[0].length).match(/^\s*(['"]?)(\w+)\1/);if(!t)return null;return t[2]}
|
|
3
|
+
export{c,i};
|