diff --git a/.eslintrc.json b/.eslintrc.json index ac9e9047..4d8409a4 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -3,6 +3,9 @@ "no-console": 0 }, "extends": [ - "@putout" + "plugin:putout/recommended" + ], + "plugins": [ + "putout" ] } diff --git a/.webpack/js.js b/.webpack/js.js index f31dde6f..7087b8ec 100644 --- a/.webpack/js.js +++ b/.webpack/js.js @@ -6,9 +6,7 @@ const { join, } = require('path'); -const { - EnvironmentPlugin, -} = require('webpack'); +const {EnvironmentPlugin} = require('webpack'); const ServiceWorkerWebpackPlugin = require('serviceworker-webpack-plugin'); diff --git a/bin/cloudcmd.js b/bin/cloudcmd.js index 862a8743..041f8d9b 100755 --- a/bin/cloudcmd.js +++ b/bin/cloudcmd.js @@ -305,9 +305,7 @@ function checkUpdate() { } function showUpdateInfo(data) { - const { - version - } = data; + const {version} = data; if (version === Info.version) return; diff --git a/bin/release.js b/bin/release.js index 73886eb5..a95813a8 100755 --- a/bin/release.js +++ b/bin/release.js @@ -24,9 +24,7 @@ function main(callback) { '**[v{{ version }}]' + '(' + link + 'v{{ version }})**\n'; - const { - version - } = Info; + const {version} = Info; cl((error, versionNew) => { if (error) @@ -54,9 +52,7 @@ function replaceVersion(name, version, versionNew, callback) { } function cl(callback) { - const { - argv - } = process; + const {argv} = process; const length = argv.length - 1; const last = process.argv[length]; const regExp = /^--(major|minor|patch)$/; diff --git a/client/client.js b/client/client.js index a6c42526..57774a5f 100644 --- a/client/client.js +++ b/client/client.js @@ -12,9 +12,7 @@ const pascalCase = require('just-pascal-case'); const isDev = process.env.NODE_ENV === 'development'; const Images = require('./dom/images'); -const { - unregisterSW, -} = require('./sw/register'); +const {unregisterSW} = require('./sw/register'); const jonny = require('jonny/legacy'); const currify = require('currify/legacy'); @@ -330,9 +328,7 @@ function CloudCmdProto(DOM) { const isRefresh = true; const history = false; const noCurrent = options ? options.noCurrent : false; - const { - currentName - } = options; + const {currentName} = options; CloudCmd.loadDir({ path, @@ -356,15 +352,11 @@ function CloudCmdProto(DOM) { */ function ajaxLoad(path, options, panel, callback) { const create = (error, json) => { - const { - RESTful - } = DOM; + const {RESTful} = DOM; const name = options.currentName || Info.name; const obj = jonny.parse(json); const isRefresh = options.refresh; - const { - noCurrent - } = options; + const {noCurrent} = options; if (!isRefresh && json) return createFileTable(obj, panel, options, callback); @@ -426,9 +418,7 @@ function CloudCmdProto(DOM) { const names = ['file', 'path', 'link', 'pathLink']; Files.get(names, (error, templFile, templPath, templLink, templPathLink) => { - const { - Dialog - } = DOM; + const {Dialog} = DOM; const panel = panelParam || DOM.getPanel(); const {prefix} = CloudCmd; @@ -440,9 +430,7 @@ function CloudCmdProto(DOM) { if (error) return Dialog.alert(TITLE, error.responseText); - const { - childNodes - } = panel; + const {childNodes} = panel; let i = childNodes.length; while (i--) diff --git a/client/dom/buffer.js b/client/dom/buffer.js index a5f1fd2a..b52fdb01 100644 --- a/client/dom/buffer.js +++ b/client/dom/buffer.js @@ -108,9 +108,7 @@ function BufferProto() { exec.parallel([copy, cut], (error, cp, ct) => { const opStr = cp ? 'copy' : 'move'; const opData = cp || ct; - const { - Operation - } = CloudCmd; + const {Operation} = CloudCmd; const msg = 'Path is same!'; const path = Info.dirPath; diff --git a/client/dom/current-file.spec.js b/client/dom/current-file.spec.js index 81537950..c8b7456e 100644 --- a/client/dom/current-file.spec.js +++ b/client/dom/current-file.spec.js @@ -106,9 +106,7 @@ test('current-file: setCurrentName: return', (t) => { }); test('current-file: getParentDirPath: result', (t) => { - const { - DOM, - } = global; + const {DOM} = global; const getCurrentDirPath = returns('/D/Films/+++favorite films/'); const getCurrentDirName = returns('+++favorite films'); diff --git a/client/dom/directory.js b/client/dom/directory.js index 9d5c58a1..3d0461db 100644 --- a/client/dom/directory.js +++ b/client/dom/directory.js @@ -8,14 +8,10 @@ const Images = require('./images'); const {FS} = require('../../common/cloudfunc'); const DOM = require('.'); -const { - getCurrentDirPath: getPathWhenRootEmpty, -} = DOM; +const {getCurrentDirPath: getPathWhenRootEmpty} = DOM; module.exports = (items) => { - const { - Dialog - } = DOM; + const {Dialog} = DOM; if (items.length) Images.show('top'); diff --git a/client/dom/dom-tree.js b/client/dom/dom-tree.js index 22103cff..be4523f3 100644 --- a/client/dom/dom-tree.js +++ b/client/dom/dom-tree.js @@ -20,9 +20,7 @@ const isContainClass = (element, className) => { if (Array.isArray(className)) return className.some(currify(isContainClass, element)); - const { - classList - } = element; + const {classList} = element; return classList.contains(className); }; diff --git a/client/dom/dom-tree.spec.js b/client/dom/dom-tree.spec.js index 2a9c767b..5090b28c 100644 --- a/client/dom/dom-tree.spec.js +++ b/client/dom/dom-tree.spec.js @@ -4,9 +4,7 @@ const test = require('supertape'); const {create} = require('auto-globals'); const tryCatch = require('try-catch'); -const { - isContainClass, -} = require('./dom-tree'); +const {isContainClass} = require('./dom-tree'); test('dom: isContainClass: no element', (t) => { const [e] = tryCatch(isContainClass); diff --git a/client/dom/images.js b/client/dom/images.js index 275bf910..8f6c5ded 100644 --- a/client/dom/images.js +++ b/client/dom/images.js @@ -47,9 +47,7 @@ function getElement() { /* Функция создаёт картинку загрузки */ module.exports.loading = () => { const element = getElement(); - const { - classList - } = element; + const {classList} = element; classList.add(LOADING, LoadingImage); classList.remove(ERROR, HIDDEN); @@ -60,9 +58,7 @@ module.exports.loading = () => { /* Функция создаёт картинку ошибки загрузки */ module.exports.error = () => { const element = getElement(); - const { - classList - } = element; + const {classList} = element; classList.add(ERROR); classList.remove(HIDDEN, LOADING, LoadingImage); diff --git a/client/dom/index.js b/client/dom/index.js index 4dde2d1f..d16e4721 100644 --- a/client/dom/index.js +++ b/client/dom/index.js @@ -319,9 +319,7 @@ function CmdProto() { */ this.getCurrentData = (callback, currentFile) => { let hash; - const { - Dialog - } = DOM; + const {Dialog} = DOM; const Info = DOM.CurrentInfo; const current = currentFile || DOM.getCurrentFile(); const path = DOM.getCurrentPath(current); @@ -334,9 +332,7 @@ function CmdProto() { if (itype.object(data)) data = jonny.stringify(data); - const { - length - } = data; + const {length} = data; if (hash && length < ONE_MEGABYTE) DOM.saveDataToStorage(path, data, hash); @@ -452,9 +448,7 @@ function CmdProto() { */ this.expandSelection = () => { const msg = 'expand'; - const { - files - } = CurrentInfo; + const {files} = CurrentInfo; selectByPattern(msg, files); }; @@ -464,9 +458,7 @@ function CmdProto() { */ this.shrinkSelection = () => { const msg = 'shrink'; - const { - files - } = CurrentInfo; + const {files} = CurrentInfo; selectByPattern(msg, files); }; @@ -548,9 +540,7 @@ function CmdProto() { * check storage hash */ this.checkStorageHash = (name, callback) => { - const { - parallel - } = exec; + const {parallel} = exec; const loadHash = DOM.loadCurrentHash; const nameHash = name + '-hash'; const getStoreHash = exec.with(Storage.get, nameHash); @@ -758,9 +748,7 @@ function CmdProto() { * @currentFile */ this.renameCurrent = (current) => { - const { - Dialog - } = DOM; + const {Dialog} = DOM; if (!DOM.isCurrentFile(current)) current = DOM.getCurrentFile(); @@ -878,9 +866,7 @@ function CmdProto() { this.goToDirectory = () => { const msg = 'Go to directory:'; const path = CurrentInfo.dirPath; - const { - Dialog - } = DOM; + const {Dialog} = DOM; const cancel = false; const setPath = (path) => ({ path @@ -893,9 +879,7 @@ function CmdProto() { this.duplicatePanel = () => { const Info = CurrentInfo; - const { - isDir - } = Info; + const {isDir} = Info; const panel = Info.panelPassive; const noCurrent = !Info.isOnePanel; @@ -939,9 +923,7 @@ function CmdProto() { path: dirPathPassive, panel }, () => { - const { - files - } = Info; + const {files} = Info; const length = files.length - 1; if (currentIndex > length) diff --git a/client/dom/load-remote.js b/client/dom/load-remote.js index 05090c42..c20b7a0d 100644 --- a/client/dom/load-remote.js +++ b/client/dom/load-remote.js @@ -25,9 +25,7 @@ module.exports = (name, options, callback = options) => { const module = findObjByNameInArr(modules.remote, name); const isArray = itype.array(module.local); - const { - version - } = module; + const {version} = module; let remoteTmpls; let local; diff --git a/client/dom/rest.js b/client/dom/rest.js index 12b7cfb6..aa0db07e 100644 --- a/client/dom/rest.js +++ b/client/dom/rest.js @@ -5,9 +5,7 @@ const itype = require('itype/legacy'); const {FS} = require('../../common/cloudfunc'); -const { - encode, -} = require('../../common/entity'); +const {encode} = require('../../common/entity'); module.exports = new RESTful(); diff --git a/client/dom/upload-files.js b/client/dom/upload-files.js index 66754014..0d564804 100644 --- a/client/dom/upload-files.js +++ b/client/dom/upload-files.js @@ -17,9 +17,7 @@ const {TITLE} = CloudCmd; const onEnd = wraptile(_onEnd); const loadFile = wraptile(_loadFile); -const { - getCurrentDirPath: getPathWhenRootEmpty -} = DOM; +const {getCurrentDirPath: getPathWhenRootEmpty} = DOM; module.exports = (dir, files) => { if (!files) { @@ -47,9 +45,7 @@ function _onEnd(currentName) { function _loadFile(dir, n, file, callback) { let i = 0; - const { - name - } = file; + const {name} = file; const path = dir + name; const {prefixURL} = CloudCmd; const api = prefixURL + FS; diff --git a/client/input.js b/client/input.js index c9d59b6d..44d97d88 100644 --- a/client/input.js +++ b/client/input.js @@ -52,9 +52,7 @@ function setState(state) { module.exports.getValue = (name, element) => { const el = getElementByName(name, element); - const { - type - } = el; + const {type} = el; switch(type) { case 'checkbox': @@ -70,9 +68,7 @@ module.exports.getValue = (name, element) => { module.exports.setValue = (name, value, element) => { const el = getElementByName(name, element); - const { - type - } = el; + const {type} = el; switch(type) { case 'checkbox': diff --git a/client/key/index.js b/client/key/index.js index 53a86452..9d592a13 100644 --- a/client/key/index.js +++ b/client/key/index.js @@ -56,9 +56,7 @@ function KeyProto() { } function listener(event) { - const { - keyCode - } = event; + const {keyCode} = event; const alt = event.altKey; const ctrl = event.ctrlKey; const shift = event.shiftKey; @@ -132,9 +130,7 @@ function KeyProto() { const {Operation} = CloudCmd; - const { - keyCode - } = event; + const {keyCode} = event; const alt = event.altKey; const shift = event.shiftKey; diff --git a/client/key/vim/find.spec.js b/client/key/vim/find.spec.js index 24c84361..63b7d7bf 100644 --- a/client/key/vim/find.spec.js +++ b/client/key/vim/find.spec.js @@ -4,9 +4,7 @@ const test = require('supertape'); const stub = require('@cloudcmd/stub'); const dir = './'; -const { - getDOM, -} = require('./globals.fixture'); +const {getDOM} = require('./globals.fixture'); global.DOM = getDOM(); diff --git a/client/key/vim/index.js b/client/key/vim/index.js index d9eb5130..62df71ad 100644 --- a/client/key/vim/index.js +++ b/client/key/vim/index.js @@ -3,9 +3,7 @@ const KEY = require('../key'); const Info = DOM.CurrentInfo; -const { - Dialog -} = DOM; +const {Dialog} = DOM; const fullstore = require('fullstore/legacy'); const store = fullstore(''); @@ -35,9 +33,7 @@ const rmFirst = (a) => { module.exports = (key, event) => { const current = Info.element; - const { - keyCode - } = event; + const {keyCode} = event; const prevStore = store(); const value = store(prevStore.concat(key)); diff --git a/client/key/vim/index.spec.js b/client/key/vim/index.spec.js index 6e3ef2c6..28ad3596 100644 --- a/client/key/vim/index.spec.js +++ b/client/key/vim/index.spec.js @@ -21,12 +21,8 @@ const { global.DOM = getDOM(); global.CloudCmd = getCloudCmd(); -const { - DOM -} = global; -const { - Buffer -} = DOM; +const {DOM} = global; +const {Buffer} = DOM; const KEY = require(pathKey); const vim = require(pathVim); diff --git a/client/listeners/index.js b/client/listeners/index.js index 8ce5c694..60b448d8 100644 --- a/client/listeners/index.js +++ b/client/listeners/index.js @@ -11,9 +11,7 @@ const getRange = require('./get-range'); const getIndex = currify(require('./get-index')); const uploadFiles = require('../dom/upload-files'); -const { - FS, -} = require('../../common/cloudfunc'); +const {FS} = require('../../common/cloudfunc'); const NBSP_REG = RegExp(String.fromCharCode(160), 'g'); const SPACE = ' '; @@ -51,9 +49,7 @@ const execAll = currify((funcs, event) => { }); const Info = DOM.CurrentInfo; -const { - Events -} = DOM; +const {Events} = DOM; const EventsFiles = { mousedown: exec.with(execIfNotUL, setCurrentFileByEvent), click: execAll([ @@ -117,13 +113,9 @@ module.exports.initKeysPanel = () => { return; Events.addClick(keysElement, ({target}) => { - const { - id - } = target; + const {id} = target; const operation = (name) => { - const { - Operation - } = CloudCmd; + const {Operation} = CloudCmd; const fn = Operation.show.bind(null, name); return fn; @@ -310,9 +302,7 @@ function onTouch(event) { function onDragStart(event) { const {prefixURL} = CloudCmd; const element = getLIElement(event.target); - const { - isDir - } = Info; + const {isDir} = Info; let link = DOM.getCurrentLink(element); let name = DOM.getCurrentName(element); @@ -445,12 +435,8 @@ function dragndrop() { * to upload file from download bar */ const onDragOver = (event) => { - const { - dataTransfer - } = event; - const { - effectAllowed - } = dataTransfer; + const {dataTransfer} = event; + const {effectAllowed} = dataTransfer; if (/move|linkMove/.test(effectAllowed)) dataTransfer.dropEffect = 'move'; @@ -471,9 +457,7 @@ function dragndrop() { function unload() { DOM.Events.add(['unload', 'beforeunload'], (event) => { - const { - Key - } = CloudCmd; + const {Key} = CloudCmd; const isBind = Key && Key.isBind(); if (isBind) diff --git a/client/modules/contact.js b/client/modules/contact.js index f33cdd8b..abcfd003 100644 --- a/client/modules/contact.js +++ b/client/modules/contact.js @@ -8,12 +8,8 @@ CloudCmd.Contact = exports; const olark = require('@cloudcmd/olark'); const Images = require('../dom/images'); -const { - Events -} = DOM; -const { - Key -} = CloudCmd; +const {Events} = DOM; +const {Key} = CloudCmd; module.exports.show = show; module.exports.hide = hide; diff --git a/client/modules/edit-file.js b/client/modules/edit-file.js index 99fe5500..0727dede 100644 --- a/client/modules/edit-file.js +++ b/client/modules/edit-file.js @@ -16,9 +16,7 @@ const { Images } = DOM; -const { - config -} = CloudCmd; +const {config} = CloudCmd; let Menu; @@ -74,9 +72,7 @@ module.exports.show = (options) => { .setOption('keyMap', 'default'); Info.getData((error, data) => { - const { - path - } = Info; + const {path} = Info; const name = getName(); if (error) diff --git a/client/modules/edit-names.js b/client/modules/edit-names.js index b67d96af..1c9db6ce 100644 --- a/client/modules/edit-names.js +++ b/client/modules/edit-names.js @@ -11,9 +11,7 @@ const supermenu = require('supermenu'); const reject = Promise.reject.bind(Promise); const Info = DOM.CurrentInfo; -const { - Dialog -} = DOM; +const {Dialog} = DOM; const TITLE = 'Edit Names'; const alert = currify(Dialog.alert, TITLE); @@ -66,9 +64,7 @@ function keyListener(event) { const ctrl = event.ctrlKey; const meta = event.metaKey; const ctrlMeta = ctrl || meta; - const { - Key - } = CloudCmd; + const {Key} = CloudCmd; if (!ctrlMeta || event.keyCode !== Key.S) return; diff --git a/client/modules/menu.js b/client/modules/menu.js index 43f280bd..141e1962 100644 --- a/client/modules/menu.js +++ b/client/modules/menu.js @@ -196,9 +196,7 @@ function isPath(x, y) { } function beforeShow(callback, params) { - const { - name - } = params; + const {name} = params; const el = DOM.getCurrentByPosition({ x: params.x, y: params.y @@ -231,9 +229,7 @@ function _uploadTo(nameModule) { if (error) return; - const { - name - } = Info; + const {name} = Info; const execFrom = CloudCmd.execFromModule; execFrom(nameModule, 'uploadFile', name, data); diff --git a/client/modules/operation/get-next-current-name.js b/client/modules/operation/get-next-current-name.js index e0256b2e..c10e2129 100644 --- a/client/modules/operation/get-next-current-name.js +++ b/client/modules/operation/get-next-current-name.js @@ -9,9 +9,7 @@ module.exports = (currentName, names, removedNames) => { const i = names.indexOf(currentName); const nextNames = notOneOf(names, removedNames); - const { - length - } = nextNames; + const {length} = nextNames; if (nextNames[i]) return nextNames[i]; diff --git a/client/modules/operation/index.js b/client/modules/operation/index.js index 656322d8..23cd66b2 100644 --- a/client/modules/operation/index.js +++ b/client/modules/operation/index.js @@ -11,9 +11,7 @@ const {promisify} = require('es6-promisify'); const exec = require('execon'); const loadJS = require('load.js').js; -const { - encode, -} = require('../../../common/entity'); +const {encode} = require('../../../common/entity'); const RESTful = require('../../dom/rest'); const removeExtension = require('./remove-extension'); @@ -389,9 +387,7 @@ function twopack(operation, type) { let fileFrom; let currentName = Info.name; - const { - Images - } = DOM; + const {Images} = DOM; const { path, diff --git a/client/modules/operation/set-listeners.js b/client/modules/operation/set-listeners.js index 33b7d802..5f7d3e34 100644 --- a/client/modules/operation/set-listeners.js +++ b/client/modules/operation/set-listeners.js @@ -9,9 +9,7 @@ const { } = DOM; const forEachKey = require('for-each-key/legacy'); -const { - TITLE, -} = CloudCmd; +const {TITLE} = CloudCmd; module.exports = (options, callback) => (emitter) => { if (!callback) { diff --git a/client/modules/terminal.js b/client/modules/terminal.js index 5dd4f332..bae97597 100644 --- a/client/modules/terminal.js +++ b/client/modules/terminal.js @@ -28,9 +28,7 @@ let Loaded; let Terminal; const loadAll = async () => { - const { - prefix, - } = CloudCmd; + const {prefix} = CloudCmd; const prefixGritty = getPrefix(); const js = `${prefixGritty}/gritty.js`; diff --git a/client/modules/view.js b/client/modules/view.js index 0e2df591..5e91a35a 100644 --- a/client/modules/view.js +++ b/client/modules/view.js @@ -40,9 +40,7 @@ const Name = 'View'; CloudCmd[Name] = module.exports; const Info = DOM.CurrentInfo; -const { - Key -} = CloudCmd; +const {Key} = CloudCmd; const basename = (a) => a.split('/').pop(); let El; diff --git a/client/sw/register.spec.js b/client/sw/register.spec.js index a4db0a0e..883d4959 100644 --- a/client/sw/register.spec.js +++ b/client/sw/register.spec.js @@ -31,9 +31,7 @@ test('sw: lesten: no sw', (t) => { }); test('sw: register: registerSW: no serviceWorker', async (t, {navigator}) => { - const { - registerSW, - } = reRequire('./register'); + const {registerSW} = reRequire('./register'); delete navigator.serviceWorker; diff --git a/common/cloudfunc.js b/common/cloudfunc.js index 861521fa..a2b79f52 100644 --- a/common/cloudfunc.js +++ b/common/cloudfunc.js @@ -3,9 +3,7 @@ const rendy = require('rendy/legacy'); const currify = require('currify/legacy'); const store = require('fullstore/legacy'); -const { - encode -} = require('./entity'); +const {encode} = require('./entity'); const btoa = require('./btoa'); const getHeaderField = currify(_getHeaderField); @@ -44,9 +42,7 @@ module.exports.getTitle = (options) => { options = options || {}; const path = options.path || Path(); - const { - name - } = options; + const {name} = options; const array = [ name || NAME, @@ -122,9 +118,7 @@ module.exports.buildFromJSON = (params) => { const path = encode(json.path); - const { - files - } = json; + const {files} = json; const sort = params.sort || 'name'; const order = params.order || 'asc'; diff --git a/common/cloudfunc.spec.js b/common/cloudfunc.spec.js index f04da04f..c72c0a80 100644 --- a/common/cloudfunc.spec.js +++ b/common/cloudfunc.spec.js @@ -2,9 +2,7 @@ const test = require('supertape'); const cloudfunc = require('./cloudfunc'); -const { - _getSize, -} = cloudfunc; +const {_getSize} = cloudfunc; test('cloudfunc: getSize: dir', (t) => { const type = 'directory'; diff --git a/package.json b/package.json index 2e49755a..6345f891 100644 --- a/package.json +++ b/package.json @@ -179,7 +179,6 @@ "@cloudcmd/modal": "^1.0.0", "@cloudcmd/olark": "^2.0.1", "@cloudcmd/stub": "^2.0.0", - "@putout/eslint-config": "^1.0.1", "auto-globals": "^1.7.0", "babel-loader": "^8.0.0", "babel-plugin-macros": "^2.2.1", @@ -193,6 +192,7 @@ "es6-promisify": "^6.0.0", "eslint": "^5.0.0", "eslint-plugin-node": "^8.0.0", + "eslint-plugin-putout": "^1.0.1", "extract-text-webpack-plugin": "^4.0.0-alpha.0", "fast-async": "^7.0.6", "file-loader": "^3.0.1", diff --git a/server/config.js b/server/config.js index 4ff8c7cf..00704144 100644 --- a/server/config.js +++ b/server/config.js @@ -31,9 +31,7 @@ const save = promisify(_save); const formatMsg = currify((a, b) => CloudFunc.formatMsg(a, b)); -const { - apiURL -} = CloudFunc; +const {apiURL} = CloudFunc; const changeEmitter = new Emitter(); const ConfigPath = path.join(DIR, 'json/config.json'); diff --git a/server/distribute/export.js b/server/distribute/export.js index 55d7281d..cce470c2 100644 --- a/server/distribute/export.js +++ b/server/distribute/export.js @@ -67,9 +67,7 @@ const push = currify((socket, key, value) => { }); function getHost(socket) { - const { - remoteAddress - } = socket.request.connection; + const {remoteAddress} = socket.request.connection; const { name, diff --git a/server/env.js b/server/env.js index a42664d4..bec9ec30 100644 --- a/server/env.js +++ b/server/env.js @@ -1,8 +1,6 @@ 'use strict'; -const { - env -} = process; +const {env} = process; const up = (a) => a.toUpperCase(); module.exports = parse; diff --git a/server/repl.js b/server/repl.js index c602d89d..0fd8dbf7 100644 --- a/server/repl.js +++ b/server/repl.js @@ -4,9 +4,7 @@ const net = require('net'); const repl = require('repl'); module.exports = net.createServer((socket) => { - const { - pid - } = process; + const {pid} = process; const addr = socket.remoteAddress; const port = socket.remotePort; diff --git a/server/rest/index.js b/server/rest/index.js index 523e840b..dcddad0b 100644 --- a/server/rest/index.js +++ b/server/rest/index.js @@ -84,9 +84,7 @@ function sendData(params, callback) { if (isMD) return markdown(p.name, p.request, callback); - const { - method - } = p.request; + const {method} = p.request; switch(method) { case 'GET': @@ -181,9 +179,7 @@ function onPUT(name, body, callback) { const from = root(files.from); const to = root(files.to); - const { - names - } = files; + const {names} = files; if (!names) return fs.rename(from, to, fn); diff --git a/server/rest/info.js b/server/rest/info.js index 787d70eb..bc63fffa 100644 --- a/server/rest/info.js +++ b/server/rest/info.js @@ -2,15 +2,11 @@ const format = require('format-io'); -const { - version -} = require('../../package'); +const {version} = require('../../package'); const config = require('../config'); const getMemory = () => { - const { - rss - } = process.memoryUsage(); + const {rss} = process.memoryUsage(); return format.size(rss); }; diff --git a/server/route.js b/server/route.js index b9d5b24d..003f6f71 100644 --- a/server/route.js +++ b/server/route.js @@ -4,9 +4,7 @@ const DIR_SERVER = './'; const DIR_COMMON = '../common/'; const fs = require('fs'); -const { - promisify, -} = require('util'); +const {promisify} = require('util'); const flop = require('flop'); const ponse = require('ponse'); @@ -113,13 +111,9 @@ function indexProcessing(options) { const noConfig = !config('configDialog'); const noConsole = !config('console'); const noTerminal = !config('terminal'); - const { - panel - } = options; + const {panel} = options; - let { - data - } = options; + let {data} = options; if (noKeysPanel) data = hideKeysPanel(data);