diff --git a/bin/now-alias.js b/bin/now-alias.js index c187c18..6db01ba 100755 --- a/bin/now-alias.js +++ b/bin/now-alias.js @@ -343,8 +343,7 @@ async function confirmDeploymentRemoval(alias, _alias) { const msg = '> The following alias will be removed permanently\n' + ` ${tbl} \nAre you sure?`; - const prompted = await promptBool(msg); - return prompted; + return promptBool(msg); } function findAlias(alias, list) { diff --git a/lib/alias.js b/lib/alias.js index 63b37a7..ba74f1c 100644 --- a/lib/alias.js +++ b/lib/alias.js @@ -99,9 +99,7 @@ module.exports = class Alias extends Now { async updatePathBasedroutes(alias, rules) { alias = await this.maybeSetUpDomain(alias); - const upsert = await this.upsertPathAlias(alias, rules); - - return upsert; + return this.upsertPathAlias(alias, rules); } async upsertPathAlias(alias, rules) { diff --git a/lib/domains.js b/lib/domains.js index 3ba05bf..bde995f 100644 --- a/lib/domains.js +++ b/lib/domains.js @@ -10,8 +10,7 @@ const domainRegex = /^((?=[a-z0-9-]{1,63}\.)(xn--)?[a-z0-9]+(-[a-z0-9]+)*\.)+[a- module.exports = class Domains extends Now { async ls() { - const domains = await this.listDomains(); - return domains; + return this.listDomains(); } async rm(name) { diff --git a/lib/get-files.js b/lib/get-files.js index 5c0d310..e94e771 100644 --- a/lib/get-files.js +++ b/lib/get-files.js @@ -306,16 +306,7 @@ async function explode(paths, { accepts, debug }) { return path; }; - const many = async all => { - const awaitAll = await Promise.all( - all.map(async file => { - const listed = await list(file); - return listed; - }) - ); - - return awaitAll; - }; + const many = async all => Promise.all(all.map(async file => list(file))); return flatten(await many(paths)).filter(v => v !== null); } diff --git a/lib/index.js b/lib/index.js index bb54e7a..87f8e64 100644 --- a/lib/index.js +++ b/lib/index.js @@ -138,7 +138,7 @@ module.exports = class Now extends EventEmitter { Array.from(this._files).map(async ([sha, { data, names }]) => { const statFn = followSymlinks ? stat : lstat; - const nameList = await names.map(async name => { + return names.map(async name => { let mode; const getMode = async () => { @@ -164,8 +164,6 @@ module.exports = class Now extends EventEmitter { mode }; }); - - return nameList; }) ) ) @@ -473,8 +471,7 @@ module.exports = class Now extends EventEmitter { console.timeEnd(`> [debug] #${attempt} GET /domains/${domain}`); } - const parsedJSON = await res.json(); - return parsedJSON; + return res.json(); }); } diff --git a/lib/plans.js b/lib/plans.js index c06b674..24bf591 100644 --- a/lib/plans.js +++ b/lib/plans.js @@ -27,9 +27,7 @@ async function parsePlan(res) { module.exports = class Plans extends Now { async getCurrent() { const res = await this._fetch('/www/user/plan'); - - const parsedPlan = await parsePlan(res); - return parsedPlan; + return parsePlan(res); } async set(plan) { @@ -39,8 +37,7 @@ module.exports = class Plans extends Now { }); if (res.ok) { - const parsedPlan = await parsePlan(res); - return parsedPlan; + return parsePlan(res); } const err = new Error(res.statusText); diff --git a/package.json b/package.json index d0f5c12..88ac37d 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,6 @@ ] }, "xo": { - "space": true, "ignores": [ "test/_fixtures/**" ],