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