import{dirname as s}from"node:path";import{getPortalConfigStats as f}from"../../../telemetry/get-portal-config-stats.js";const r=20,g=512*1024,d=async({context:n})=>{const e=[];let o=0;for(const{relativePath:i,isVirtual:a}of n.fs.scan(/redocly\.yaml$/)){if(a||i==="redocly.yaml")continue;if(e.length>=r)break;const t=f(await n.getConfig(s(i)));if(t!==void 0){if(o+=Buffer.byteLength(t,"utf8"),o>g)break;e.push(t)}}return{version:"1",name:"nestedConfigStats",value:e.length>0?`[${e.join(",")}]`:void 0}};export{d as getNestedConfigsUsage};
