var k=Object.defineProperty;var h=(e,r)=>k(e,"name",{value:r,configurable:!0});import{m as c,V as $,P}from"../packem_chunks/bin.js";import{C as f,l,M as d}from"./readFileSync-DseCu8sg-DEq4Fn3a.js";var S=Object.defineProperty,m=h((e,r)=>S(e,"name",{value:r,configurable:!0}),"o");const y=/\/+$/,p=/node_modules/,u=/\.git/,M=/[$()+.?[\\\]^{|}]/g,W=/\/\*\*$|\/\*\/\*$/,x=m((e,r)=>{const n=r.replace(y,"");if(n.startsWith("!"))return[];const s=[];if(n.endsWith("/*")){const t=n.slice(0,-2),i=f(e,t);if(!l(i))return[];for(const a of c(i,{includeFiles:!1,includeSymlinks:!1,maxDepth:1,skip:[p,u]}))a.path===i||a.name.startsWith(".")||s.push(d(t,a.name));return s}if(n.endsWith("/**")||n.endsWith("/*/*")){const t=n.replace(W,""),i=f(e,t);if(!l(i))return[];for(const a of c(i,{includeFiles:!1,includeSymlinks:!1,skip:[p,u]})){if(a.path===i)continue;const g=a.path.slice(i.length+1);s.push(`${t}/${g}`)}return s}if(!n.includes("/")&&n.includes("*")){const t=n.replaceAll(M,String.raw`\$&`).replaceAll("*",".*"),i=new RegExp(`^${t}$`);for(const a of c(e,{includeFiles:!1,includeSymlinks:!1,maxDepth:1,skip:[p,u]}))a.path!==e&&i.test(a.name)&&s.push(a.name);return s}const o=f(e,n);return l(o)&&s.push(n),s},"collectPatternMatches"),F=m(e=>{const r=$(e)??P(e)??[],n=new Set,s=[];for(const o of r)for(const t of x(e,o))t==="."||n.has(t)||(n.add(t),l(d(e,t,"package.json"))||s.push({packageDir:t}));return s},"lintMissingPackageJson");export{F as l};
