diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/render-msg.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/render-msg.js b/lib/render-msg.js index 7d34fc3..adf13bb 100644 --- a/lib/render-msg.js +++ b/lib/render-msg.js @@ -1070,13 +1070,15 @@ RenderMsg.prototype.npmPackages = function (cb) { } self.render.npmPackageMentions(self.c.mentions, function (err, el) { if (err) return cb(err) + var dependencyLinks = u.toArray(self.c.dependencyBranch) + var versionLinks = u.toArray(self.c.versionBranch) self.wrap(h('div', [ el, - Array.isArray(self.c.dependencyBranch) ? h('div', - 'dependencies via: ', self.c.dependencyBranch.map(renderIdLink) + dependencyLinks.length ? h('div', + 'dependencies via: ', dependencyLinks.map(renderIdLink) ) : '', - Array.isArray(self.c.versionBranch) ? h('div', - 'previous versions: ', self.c.versionBranch.map(renderIdLink) + versionLinks.length ? h('div', + 'previous versions: ', versionLinks.map(renderIdLink) ) : '' ]), elCb) return done(cb) |