Skip to content

Commit

Permalink
Convert Program.js to async/await
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcanessa committed Oct 15, 2017
1 parent 285cfa4 commit 21bda67
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions lib/src/Program.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,18 @@ class Program {
*
* @return {Promise}
*/
init() {
return this._getEnvOptions()
.then(options => {
this.options = this._filterObject(this._camelCaseObjectKeys(
Object.assign(
{},
this.defaults,
Object.assign({}, ...[].concat(options)),
this.options
)
));

return this.options;
});
async init() {
const options = await this._getEnvOptions();
this.options = this._filterObject(this._camelCaseObjectKeys(
Object.assign(
{},
this.defaults,
Object.assign({}, ...[].concat(options)),
this.options
)
));

return this.options;
}

/**
Expand Down

0 comments on commit 21bda67

Please sign in to comment.