import{__exports as t}from"../../../../../_virtual/sync6.mjs";import{__require as r}from"../../../fs.stat/out/index.mjs";import{__require as e}from"../constants.mjs";import{__require as n}from"../utils/index.mjs";import{__require as i}from"./common.mjs";var a;function s(){if(a)return t;a=1,Object.defineProperty(t,"__esModule",{value:!0}),t.readdir=t.readdirWithFileTypes=t.read=void 0;const s=r(),o=e(),m=n(),c=i();function d(t,r){return r.fs.readdirSync(t,{withFileTypes:!0}).map(e=>{const n={dirent:e,name:e.name,path:c.joinPathSegments(t,e.name,r.pathSegmentSeparator)};if(n.dirent.isSymbolicLink()&&r.followSymbolicLinks)try{const t=r.fs.statSync(n.path);n.dirent=m.fs.createDirentFromStats(n.name,t)}catch(t){if(r.throwErrorOnBrokenSymbolicLink)throw t}return n})}function f(t,r){return r.fs.readdirSync(t).map(e=>{const n=c.joinPathSegments(t,e,r.pathSegmentSeparator),i=s.statSync(n,r.fsStatSettings),a={name:e,path:n,dirent:m.fs.createDirentFromStats(e,i)};return r.stats&&(a.stats=i),a})}return t.read=function(t,r){return!r.stats&&o.IS_SUPPORT_READDIR_WITH_FILE_TYPES?d(t,r):f(t,r)},t.readdirWithFileTypes=d,t.readdir=f,t}export{s as __require};