return (a, b) => { if (a.type !== b.type) { return isDirectory(a) ? -1 : 1 } return sort.order === 'desc' ? b.name.localeCompare(a.name) : a.name.localeCompare(b.name) }
export const getFilePath = ({ view }, file) => { const { displayedFolder } = view if (isDirectory(file)) { return file.path } else { const folderPath = displayedFolder ? !isRootFolder(displayedFolder) ? displayedFolder.path : '' : file.path // file.path is the parent folder path return `${folderPath}/${file.name}` } }