Skip to content

Commit 7f0617b

Browse files
committed
chore: lint
1 parent 907afc6 commit 7f0617b

File tree

3 files changed

+9
-12
lines changed

3 files changed

+9
-12
lines changed

server/config.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const criton = require('criton');
2222
const exit = require(`${DIR_SERVER}exit`);
2323

2424
const CloudFunc = require(`${DIR_COMMON}cloudfunc`);
25-
25+
const isUndefined = (a) => typeof a === 'undefined';
2626
const DIR = `${DIR_SERVER}../`;
2727
const HOME = homedir();
2828

@@ -31,7 +31,9 @@ const formatMsg = currify((a, b) => CloudFunc.formatMsg(a, b));
3131

3232
const {apiURL} = CloudFunc;
3333

34-
const key = (a) => Object.keys(a).pop();
34+
const key = (a) => Object
35+
.keys(a)
36+
.pop();
3537

3638
const ConfigPath = path.join(DIR, 'json/config.json');
3739
const ConfigHome = path.join(HOME, '.cloudcmd.json');
@@ -90,7 +92,7 @@ function createConfig({configPath} = {}) {
9092
if (key === '*')
9193
return config;
9294

93-
if (value === undefined)
95+
if (isUndefined(value))
9496
return config[key];
9597

9698
config[key] = value;

server/rest/index.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ const root = require(`../root`);
2121
const CloudFunc = require(`../../common/cloudfunc`);
2222
const markdown = require(`../markdown/index.js`);
2323
const info = require('./info');
24-
24+
const isUndefined = (a) => typeof a === 'undefined';
25+
const isRootAll = (root, names) => names.some(isRootWin32(root));
2526
const isString = (a) => typeof a === 'string';
2627
const isFn = (a) => typeof a === 'function';
2728
const swap = wraptile((fn, a, b) => fn(b, a));
@@ -66,7 +67,7 @@ function rest({fs, config, moveFiles}, request, response) {
6667
if (options.name)
6768
params.name = options.name;
6869

69-
if (options.gzip !== undefined)
70+
if (!isUndefined(options.gzip))
7071
params.gzip = options.gzip;
7172

7273
if (options.query)
@@ -370,10 +371,6 @@ const isRootWin32 = currify((root, path) => {
370371
module.exports._isRootWin32 = isRootWin32;
371372
module.exports._isRootAll = isRootAll;
372373

373-
function isRootAll(root, names) {
374-
return names.some(isRootWin32(root));
375-
}
376-
377374
module.exports._getWin32RootMsg = getWin32RootMsg;
378375

379376
function getWin32RootMsg() {

server/terminal.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ const noop = (req, res, next) => {
88

99
noop.listen = noop;
1010

11-
function _getModule(a) {
12-
return require(a);
13-
}
11+
const _getModule = (a) => require(a);
1412

1513
module.exports = (config, arg, overrides = {}) => {
1614
const {

0 commit comments

Comments
 (0)