import t from"path";import{CONFIG_FILE_NAME as n}from"../../../../constants/index.js";const h=async(l,{fs:o,cache:r,isPathIgnored:d})=>{let e=l,a=t.posix.join(e,n),i=await o.getFileInfo(a);for(;e!=="."&&!i;)e=t.posix.dirname(e),a=t.posix.join(e,n),!await d(a)&&(i=await o.getFileInfo(a));return{...(await r.load(i?.realRelativePath||a,"redocly-config",o.localeFolders)).data,configPath:i?.relativePath||a,realConfigPath:i?.realRelativePath||a}};export{h as nearestRedoclyConfigLoader};
