From d6674aed3eb0f026dbb545dd3b045e7c0c697431 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Sat, 16 Feb 2019 21:12:32 +0200 Subject: [PATCH] feature(package) putout v4.0.0 --- .putout.json | 3 --- client/client.js | 4 ++-- client/dom/current-file.js | 4 ++-- client/dom/index.js | 2 +- client/modules/operation/index.js | 4 ++-- package.json | 2 +- 6 files changed, 8 insertions(+), 11 deletions(-) diff --git a/.putout.json b/.putout.json index 37debc61..9a634682 100644 --- a/.putout.json +++ b/.putout.json @@ -10,9 +10,6 @@ "client/(client|cloudcmd|load-module).js": { "remove-console": false }, - "bin": { - "remove-console": false - }, "test/common/cloudfunc.js": { "remove-console": false }, diff --git a/client/client.js b/client/client.js index 20a1361f..e4a13a1d 100644 --- a/client/client.js +++ b/client/client.js @@ -459,7 +459,7 @@ function CloudCmdProto(DOM) { current = DOM.getCurrentByName(dir); if (!current) - current = DOM.getFiles(panel)[0]; + [current] = DOM.getFiles(panel); DOM.setCurrentFile(current, { history, @@ -528,7 +528,7 @@ function CloudCmdProto(DOM) { CloudCmd.loadDir({path}, () => { const {panel} = Info; const current = DOM.getCurrentByName(dir); - const first = DOM.getFiles(panel)[0]; + const [first] = DOM.getFiles(panel); DOM.setCurrentFile(current || first, { history, diff --git a/client/dom/current-file.js b/client/dom/current-file.js index d0dd578b..b319db57 100644 --- a/client/dom/current-file.js +++ b/client/dom/current-file.js @@ -57,7 +57,7 @@ module.exports.getCurrentName = (currentFile) => { if (!current) return ''; - + const link = DOM.getCurrentLink(current); if (!link) @@ -83,7 +83,7 @@ module.exports.getCurrentDirPath = (panel = DOM.getPanel()) => { */ module.exports.getCurrentPath = (currentFile) => { const current = currentFile || DOM.getCurrentFile(); - const element = DOM.getByTag('a', current)[0]; + const [element] = DOM.getByTag('a', current); const {prefix} = CloudCmd; const path = element diff --git a/client/dom/index.js b/client/dom/index.js index 2eb64e3b..900b1313 100644 --- a/client/dom/index.js +++ b/client/dom/index.js @@ -844,7 +844,7 @@ function CmdProto() { current = DOM.getCurrentByName(name, panel); if (!current) - current = filesPassive[0]; + [current] = filesPassive; } DOM.setCurrentFile(current, { diff --git a/client/modules/operation/index.js b/client/modules/operation/index.js index db79fa7f..dfb57db9 100644 --- a/client/modules/operation/index.js +++ b/client/modules/operation/index.js @@ -314,7 +314,7 @@ function _processFiles(options, data) { if (!names.length) names.push(DOM.getCurrentName()); - const name = names[0]; + const [name] = names; const sameName = DOM.getCurrentByName(name, panel); @@ -444,7 +444,7 @@ function twopack(operation, type) { function message(msg, to, names) { const n = names.length; - const name = names[0]; + const [name] = names; msg += ' '; diff --git a/package.json b/package.json index a325e86d..9d4e70eb 100644 --- a/package.json +++ b/package.json @@ -182,7 +182,7 @@ "optimize-css-assets-webpack-plugin": "^5.0.0", "philip": "^2.0.0", "place": "^1.1.4", - "putout": "^3.0.0", + "putout": "^4.0.0", "readjson": "^1.1.3", "request": "^2.76.0", "rimraf": "^2.5.4",