Skip to content

Commit

Permalink
chore: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
coderaiser committed Jan 20, 2025
1 parent 907afc6 commit 7f0617b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
8 changes: 5 additions & 3 deletions server/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const criton = require('criton');
const exit = require(`${DIR_SERVER}exit`);

const CloudFunc = require(`${DIR_COMMON}cloudfunc`);

const isUndefined = (a) => typeof a === 'undefined';
const DIR = `${DIR_SERVER}../`;
const HOME = homedir();

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

const {apiURL} = CloudFunc;

const key = (a) => Object.keys(a).pop();
const key = (a) => Object
.keys(a)
.pop();

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

if (value === undefined)
if (isUndefined(value))
return config[key];

config[key] = value;
Expand Down
9 changes: 3 additions & 6 deletions server/rest/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ const root = require(`../root`);
const CloudFunc = require(`../../common/cloudfunc`);
const markdown = require(`../markdown/index.js`);
const info = require('./info');

const isUndefined = (a) => typeof a === 'undefined';
const isRootAll = (root, names) => names.some(isRootWin32(root));
const isString = (a) => typeof a === 'string';
const isFn = (a) => typeof a === 'function';
const swap = wraptile((fn, a, b) => fn(b, a));
Expand Down Expand Up @@ -66,7 +67,7 @@ function rest({fs, config, moveFiles}, request, response) {
if (options.name)
params.name = options.name;

if (options.gzip !== undefined)
if (!isUndefined(options.gzip))
params.gzip = options.gzip;

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

function isRootAll(root, names) {
return names.some(isRootWin32(root));
}

module.exports._getWin32RootMsg = getWin32RootMsg;

function getWin32RootMsg() {
Expand Down
4 changes: 1 addition & 3 deletions server/terminal.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ const noop = (req, res, next) => {

noop.listen = noop;

function _getModule(a) {
return require(a);
}
const _getModule = (a) => require(a);

module.exports = (config, arg, overrides = {}) => {
const {
Expand Down

0 comments on commit 7f0617b

Please sign in to comment.