formacao
This commit is contained in:
+3
-12
@@ -12,12 +12,7 @@ const makeCommand = (syncFile, asyncFile, syncNoFile, asyncNoFile, validate) =>
|
||||
cb = entries;
|
||||
entries = undefined;
|
||||
}
|
||||
if (!entries) {
|
||||
entries = [];
|
||||
}
|
||||
else {
|
||||
entries = Array.from(entries);
|
||||
}
|
||||
entries = !entries ? [] : Array.from(entries);
|
||||
const opt = (0, options_js_1.dealias)(opt_);
|
||||
validate?.(opt, entries);
|
||||
if ((0, options_js_1.isSyncFile)(opt)) {
|
||||
@@ -28,9 +23,7 @@ const makeCommand = (syncFile, asyncFile, syncNoFile, asyncNoFile, validate) =>
|
||||
}
|
||||
else if ((0, options_js_1.isAsyncFile)(opt)) {
|
||||
const p = asyncFile(opt, entries);
|
||||
// weirdness to make TS happy
|
||||
const c = cb ? cb : undefined;
|
||||
return c ? p.then(() => c(), c) : p;
|
||||
return cb ? p.then(() => cb(), cb) : p;
|
||||
}
|
||||
else if ((0, options_js_1.isSyncNoFile)(opt)) {
|
||||
if (typeof cb === 'function') {
|
||||
@@ -45,9 +38,7 @@ const makeCommand = (syncFile, asyncFile, syncNoFile, asyncNoFile, validate) =>
|
||||
return asyncNoFile(opt, entries);
|
||||
/* c8 ignore start */
|
||||
}
|
||||
else {
|
||||
throw new Error('impossible options??');
|
||||
}
|
||||
throw new Error('impossible options??');
|
||||
/* c8 ignore stop */
|
||||
}, {
|
||||
syncFile,
|
||||
|
||||
Reference in New Issue
Block a user