Skip to content

Commit

Permalink
More idiomatic ES6 usage
Browse files Browse the repository at this point in the history
  • Loading branch information
devinivy committed Aug 6, 2018
1 parent bc347b0 commit 1d3c265
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/index.js
Expand Up @@ -29,10 +29,10 @@ module.exports = class Topo {
const group = options.group || '?';
const sort = options.sort || 0; // Used for merging only

Hoek.assert(before.indexOf(group) === -1, 'Item cannot come before itself:', group);
Hoek.assert(before.indexOf('?') === -1, 'Item cannot come before unassociated items');
Hoek.assert(after.indexOf(group) === -1, 'Item cannot come after itself:', group);
Hoek.assert(after.indexOf('?') === -1, 'Item cannot come after unassociated items');
Hoek.assert(!before.includes(group), `Item cannot come before itself: ${group}`);
Hoek.assert(!before.includes('?'), 'Item cannot come before unassociated items');
Hoek.assert(!after.includes(group), `Item cannot come after itself: ${group}`);
Hoek.assert(!after.includes('?'), 'Item cannot come after unassociated items');

([].concat(nodes)).forEach((node, i) => {

Expand All @@ -51,7 +51,7 @@ module.exports = class Topo {
// Insert event

const error = this._sort();
Hoek.assert(!error, 'item', (group !== '?' ? 'added into group ' + group : ''), 'created a dependencies error');
Hoek.assert(!error, 'item', (group !== '?' ? `added into group ${group}` : ''), 'created a dependencies error');

return this.nodes;
}
Expand Down

0 comments on commit 1d3c265

Please sign in to comment.