mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
chore: lint
This commit is contained in:
parent
907afc6e4a
commit
ddd1722f39
7 changed files with 24 additions and 31 deletions
|
|
@ -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();
|
||||
|
||||
|
|
@ -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');
|
||||
|
|
@ -90,7 +92,7 @@ function createConfig({configPath} = {}) {
|
|||
if (key === '*')
|
||||
return config;
|
||||
|
||||
if (value === undefined)
|
||||
if (isUndefined(value))
|
||||
return config[key];
|
||||
|
||||
config[key] = value;
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
|
|
@ -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)
|
||||
|
|
@ -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() {
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue