sortDir(list, fileBrowser, mode = "both") {
		const dir = [];
		const file = [];
		const sortByName = fileBrowser.sortByName;
		const showHiddenFile = fileBrowser.showHiddenFiles;

		list.forEach((item) => {
			let hidden;

			item.name = item.name || path.basename(item.url || "");
			hidden = item.name[0] === ".";

			if (typeof item.isDirectory !== "boolean") {
				if (this.isDir(item.type)) item.isDirectory = true;
			}
			if (!item.type) item.type = item.isDirectory ? "dir" : "file";
			if (!item.url) item.url = item.url || item.uri;
			if ((hidden && showHiddenFile) || !hidden) {
				if (item.isDirectory) {
					dir.push(item);
				} else if (item.isFile) {
					file.push(item);
				}
			}
			if (item.isDirectory) {
				item.icon = "folder";
			} else {
				if (mode === "folder") {
					item.disabled = true;
				}
				item.icon = this.getIconForFile(item.name);
			}
		});

		if (sortByName) {
			dir.sort(compare);
			file.sort(compare);
		}

		return dir.concat(file);

		function compare(a, b) {
			return a.name.toLowerCase() < b.name.toLowerCase() ? -1 : 1;
		}
	}
@param {FileEntry[]} list
@param {object} fileBrowser settings
@param {'both'|'file'|'folder'}