mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-18 00:47:01 +00:00
chore: lint
This commit is contained in:
parent
907afc6e4a
commit
ddd1722f39
7 changed files with 24 additions and 31 deletions
|
|
@ -17,11 +17,11 @@ process.on('unhandledRejection', exit);
|
|||
const require = createRequire(import.meta.url);
|
||||
|
||||
const Info = require('../package.json');
|
||||
|
||||
const isUndefined = (a) => typeof a === 'undefined';
|
||||
const simport = createSimport(import.meta.url);
|
||||
|
||||
const choose = (a, b) => {
|
||||
if (a === undefined)
|
||||
if (isUndefined(a))
|
||||
return b;
|
||||
|
||||
return a;
|
||||
|
|
|
|||
|
|
@ -248,14 +248,12 @@ module.exports.buildFromJSON = (params) => {
|
|||
return fileTable;
|
||||
};
|
||||
|
||||
function updateField(file) {
|
||||
return {
|
||||
...file,
|
||||
date: file.date || '--.--.----',
|
||||
owner: file.owner || 'root',
|
||||
size: getSize(file),
|
||||
};
|
||||
}
|
||||
const updateField = (file) => ({
|
||||
...file,
|
||||
date: file.date || '--.--.----',
|
||||
owner: file.owner || 'root',
|
||||
size: getSize(file),
|
||||
});
|
||||
|
||||
function getAttribute(type) {
|
||||
if (type === 'directory')
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
@supports (overflow: overlay) {
|
||||
.files {
|
||||
overflow-y: overlay;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.fm-header {
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -337,11 +337,9 @@ function getDOM() {
|
|||
};
|
||||
}
|
||||
|
||||
function getCloudCmd() {
|
||||
return {
|
||||
refresh: stub(),
|
||||
EditFile: {
|
||||
show: stub(),
|
||||
},
|
||||
};
|
||||
}
|
||||
const getCloudCmd = () => ({
|
||||
refresh: stub(),
|
||||
EditFile: {
|
||||
show: stub(),
|
||||
},
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue