diff --git a/client/dom/current-file.js b/client/dom/current-file.js index 917de0a0..2ded2c96 100644 --- a/client/dom/current-file.js +++ b/client/dom/current-file.js @@ -78,6 +78,7 @@ const parseNameAttribute = (attribute) => { attribute = attribute.replace('js-file-', ''); return decodeNBSP(decodeURI(atob(attribute))); }; + module.exports._parseNameAttribute = parseNameAttribute; const parseHrefAttribute = (prefix, attribute) => { diff --git a/client/modules/command-line.js b/client/modules/command-line.js index dc77dabf..bf53ce99 100644 --- a/client/modules/command-line.js +++ b/client/modules/command-line.js @@ -6,7 +6,9 @@ CloudCmd.CommandLine = exports; const Dialog = require('../dom/dialog'); -module.exports.init = () => {}; +const noop = () => {}; + +module.exports.init = noop; module.exports.show = show; module.exports.hide = hide; diff --git a/package.json b/package.json index 04ca215e..db8686c6 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,6 @@ "name": "cloudcmd", "version": "16.13.1", "type": "commonjs", - "commitType": "colon", "author": "coderaiser (https://github.com/coderaiser)", "description": "File manager for the web with console and editor", "homepage": "http://cloudcmd.io", @@ -127,7 +126,7 @@ "package-json": "^8.1.0", "ponse": "^7.0.0", "pullout": "^4.0.0", - "putout": "^28.0.0", + "putout": "^29.0.3", "redzip": "^2.0.0", "rendy": "^3.0.0", "restafary": "^11.0.0", diff --git a/server/config.js b/server/config.js index 56a39956..85e67fd7 100644 --- a/server/config.js +++ b/server/config.js @@ -107,8 +107,7 @@ function createConfig({configPath} = {}) { }; configManager.unsubscribe = (fn) => { - // replace to off on node v10 - changeEmitter.removeListener('change', fn); + changeEmitter.off('change', fn); }; return configManager; diff --git a/server/distribute/import.js b/server/distribute/import.js index 783e4d87..347765e0 100644 --- a/server/distribute/import.js +++ b/server/distribute/import.js @@ -9,6 +9,7 @@ const io = require('socket.io-client'); const log = require('./log'); const env = require('../env'); +const noop = () => {}; const forEachKey = currify(require('for-each-key')); const { @@ -43,7 +44,7 @@ const rmListeners = wraptile((socket, listeners) => { const canceled = (f) => f(null, { status: 'canceled', - disconnect: () => {}, + disconnect: noop, }); const done = wraptile((fn, store) => fn(null, { diff --git a/test/client/listeners/get-index.js b/test/client/listeners/get-index.js index 0f13acd6..27504d61 100644 --- a/test/client/listeners/get-index.js +++ b/test/client/listeners/get-index.js @@ -13,7 +13,10 @@ test('cloudcmd: client: listeners: getIndex: not found', (t) => { }); test('cloudcmd: client: listeners: getIndex: found', (t) => { - const array = ['hello', 'world']; + const array = [ + 'hello', + 'world', + ]; t.equal(getIndex(array, 'world'), 1, 'should return index'); t.end(); diff --git a/test/client/listeners/get-range.js b/test/client/listeners/get-range.js index 1cd7cd7b..6ec693f1 100644 --- a/test/client/listeners/get-range.js +++ b/test/client/listeners/get-range.js @@ -6,7 +6,10 @@ const dir = '../../../client/listeners'; const getRange = require(`${dir}/get-range`); test('cloudcmd: client: listeners: getRange: direct', (t) => { - const expected = ['hello', 'world']; + const expected = [ + 'hello', + 'world', + ]; const files = [...expected, 'how', 'come']; const result = getRange(0, 1, files); @@ -15,7 +18,10 @@ test('cloudcmd: client: listeners: getRange: direct', (t) => { }); test('cloudcmd: client: listeners: getRange: reverse', (t) => { - const expected = ['hello', 'world']; + const expected = [ + 'hello', + 'world', + ]; const files = [...expected, 'how', 'come']; const result = getRange(1, 0, files); diff --git a/test/rest/copy.js b/test/rest/copy.js index 15e24756..bc360f06 100644 --- a/test/rest/copy.js +++ b/test/rest/copy.js @@ -11,6 +11,7 @@ const config = { const cloudcmd = require('../..'); const configManager = cloudcmd.createConfigManager(); + configManager('auth', false); const {request} = require('serve-once')(cloudcmd, {