mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
chore(cloudcmd) lint
This commit is contained in:
parent
a024dcdb61
commit
5accfeeaa7
3 changed files with 12 additions and 5 deletions
|
|
@ -45,6 +45,9 @@ const initAuth = currify(_initAuth);
|
|||
const notEmpty = (a) => a;
|
||||
const clean = (a) => a.filter(notEmpty);
|
||||
|
||||
const isUndefined = (a) => typeof a === 'undefined';
|
||||
const isFn = (a) => typeof a === 'function';
|
||||
|
||||
module.exports = (params) => {
|
||||
const p = params || {};
|
||||
const options = p.config || {};
|
||||
|
|
@ -98,7 +101,7 @@ function defaultValue(config, name, options) {
|
|||
const value = options[name];
|
||||
const previous = config(name);
|
||||
|
||||
if (typeof value === 'undefined')
|
||||
if (isUndefined(value))
|
||||
return previous;
|
||||
|
||||
return value;
|
||||
|
|
@ -106,7 +109,7 @@ function defaultValue(config, name, options) {
|
|||
|
||||
module.exports._getPrefix = getPrefix;
|
||||
function getPrefix(prefix) {
|
||||
if (typeof prefix === 'function')
|
||||
if (isFn(prefix))
|
||||
return prefix() || '';
|
||||
|
||||
return prefix || '';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue