Skip to content

Commit

Permalink
Merge pull request Ryanair#4 from AIOrc/bugfix/scope
Browse files Browse the repository at this point in the history
fix(scope): Fix scope trimming arrays
  • Loading branch information
izifortune authored Jul 24, 2018
2 parents 0d81b06 + 8c8c885 commit 5419a8a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,12 @@ module.exports = function (options) {
};

// parentheses are only needed when a scope is present
var scope = answers.scope.trim();
scope = scope ? '(' + answers.scope.trim() + ')' : '';
var scope = answers.scope;
if (Array.isArray(scope)) {
scope = scope.join(', ');
}
scope = scope.trim();
scope = scope ? '(' + scope + ')' : '';

// Hard limit this line
var head = (answers.type + scope + ': ' + answers.subject.trim()).slice(0, maxLineWidth);
Expand Down

0 comments on commit 5419a8a

Please sign in to comment.