minor refactor: simplify options setting

This commit is contained in:
Iuri Matias 2017-12-16 11:11:29 -05:00
parent fb8d3c4c0a
commit 26b070b27f
1 changed files with 5 additions and 5 deletions

View File

@ -2,18 +2,18 @@ let blessed = require("blessed");
let CommandHistory = require('./command_history.js'); let CommandHistory = require('./command_history.js');
class Dashboard { class Dashboard {
constructor(options) { constructor(_options) {
let title = (options && options.title) || "Embark " + options.version; let options = _options || {};
this.env = options.env; this.env = options.env;
this.console = options.console; this.console = options.console;
this.history = new CommandHistory(); this.history = new CommandHistory();
this.color = (options && options.color) || "green"; this.color = options.color || "green";
this.minimal = (options && options.minimal) || false; this.minimal = options.minimal || false;
this.screen = blessed.screen({ this.screen = blessed.screen({
smartCSR: true, smartCSR: true,
title: title, title: options.title || ("Embark " + options.version),
dockBorders: false, dockBorders: false,
fullUnicode: true, fullUnicode: true,
autoPadding: true autoPadding: true