Skip to content

Commit 21bda67

Browse files
committed
Convert Program.js to async/await
1 parent 285cfa4 commit 21bda67

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

lib/src/Program.js

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,18 @@ class Program {
2727
*
2828
* @return {Promise}
2929
*/
30-
init() {
31-
return this._getEnvOptions()
32-
.then(options => {
33-
this.options = this._filterObject(this._camelCaseObjectKeys(
34-
Object.assign(
35-
{},
36-
this.defaults,
37-
Object.assign({}, ...[].concat(options)),
38-
this.options
39-
)
40-
));
41-
42-
return this.options;
43-
});
30+
async init() {
31+
const options = await this._getEnvOptions();
32+
this.options = this._filterObject(this._camelCaseObjectKeys(
33+
Object.assign(
34+
{},
35+
this.defaults,
36+
Object.assign({}, ...[].concat(options)),
37+
this.options
38+
)
39+
));
40+
41+
return this.options;
4442
}
4543

4644
/**

0 commit comments

Comments
 (0)