function e(e){return e.filter(e=>e.name&&e.name!==`.`&&e.name!==`..`).map(e=>{let t=e.type===`directory`||!!e.is_dir,n=e.type===`symlink`||!!e.is_link,r=0;if(!t&&!n&&e.size!=null){let t=typeof e.size==`number`?e.size:parseInt(String(e.size),10);r=Number.isFinite(t)?t:0}let i=`file`;return t?i=`directory`:n&&(i=`symlink`),{name:e.name,type:i,size:r,modified:e.modified??``,permissions:e.permissions??e.perms??``,link_target:e.link_target??null}})}function t(t){if(Array.isArray(t))return{items:t};let n=t;return Array.isArray(n.items)?{items:n.items,error:n.error}:n.entries?.length?{items:e(n.entries),error:n.error}:{items:n.items??[],error:n.error}}export{t};