mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-08-03 21:23:05 +00:00
chore(cloudcmd) lint
This commit is contained in:
parent
d473a7e187
commit
794caced01
15 changed files with 42 additions and 35 deletions
|
|
@ -42,7 +42,7 @@ function BufferProto() {
|
|||
function rmCutClass() {
|
||||
const files = DOM.getByClassAll(CLASS);
|
||||
|
||||
for (const element of [...files]) {
|
||||
for (const element of files) {
|
||||
element.classList.remove(CLASS);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ module.exports = (items) => {
|
|||
if (items.length)
|
||||
Images.show('top');
|
||||
|
||||
const entries = [...items].map((item) => {
|
||||
const entries = Array.from(items).map((item) => {
|
||||
return item.webkitGetAsEntry();
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ async function getFile(name) {
|
|||
check(name);
|
||||
|
||||
if (type === 'string')
|
||||
return getModule(name);
|
||||
return await getModule(name);
|
||||
|
||||
if (type === 'array')
|
||||
return Promise.all(unaryMap(name, get));
|
||||
|
|
|
|||
|
|
@ -173,7 +173,7 @@ function CmdProto() {
|
|||
const panel = DOM.getPanel();
|
||||
const selected = DOM.getByClassAll(SELECTED_FILE, panel);
|
||||
|
||||
return [...selected];
|
||||
return Array.from(selected);
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
@ -182,7 +182,7 @@ function CmdProto() {
|
|||
this.unselectFiles = (files) => {
|
||||
files = files || DOM.getSelectedFiles();
|
||||
|
||||
[...files].forEach(DOM.toggleSelectedFile);
|
||||
Array.from(files).forEach(DOM.toggleSelectedFile);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -412,7 +412,7 @@ function CmdProto() {
|
|||
const from = (a) => a === '..' ? 1 : 0;
|
||||
const i = from(name);
|
||||
|
||||
return [...files].slice(i);
|
||||
return Array.from(files).slice(i);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -496,7 +496,7 @@ function CmdProto() {
|
|||
const first = files[0] || DOM.getCurrentFile();
|
||||
const name = DOM.getCurrentName(first);
|
||||
|
||||
const allFiles = [...files];
|
||||
const allFiles = Array.from(files);
|
||||
|
||||
if (name === '..')
|
||||
allFiles.shift();
|
||||
|
|
@ -852,13 +852,13 @@ function CmdProto() {
|
|||
panelPassive,
|
||||
} = Info;
|
||||
|
||||
const dirPath = DOM.getCurrentDirPath();
|
||||
const path = DOM.getCurrentDirPath();
|
||||
const dirPathPassive = DOM.getNotCurrentDirPath();
|
||||
|
||||
let currentIndex = files.indexOf(element);
|
||||
|
||||
CloudCmd.loadDir({
|
||||
path: dirPath,
|
||||
path,
|
||||
panel: panelPassive,
|
||||
noCurrent: true,
|
||||
});
|
||||
|
|
@ -901,8 +901,8 @@ function CmdProto() {
|
|||
info.parentDirPath = DOM.getParentDirPath();
|
||||
info.element = current;
|
||||
info.ext = Util.getExt(name);
|
||||
info.files = [...files.children];
|
||||
info.filesPassive = [...filesPassive];
|
||||
info.files = Array.from(files.children);
|
||||
info.filesPassive = Array.from(filesPassive);
|
||||
info.first = files.firstChild;
|
||||
info.getData = DOM.getCurrentData;
|
||||
info.last = files.lastChild;
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ module.exports = (dir, files) => {
|
|||
if (!n)
|
||||
return;
|
||||
|
||||
const array = [...files];
|
||||
const array = Array.from(files);
|
||||
const {name} = files[0];
|
||||
|
||||
eachSeries(array, loadFile(dir, n), onEnd(name));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue