diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/render-msg.js | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/render-msg.js b/lib/render-msg.js index 4374165..a968702 100644 --- a/lib/render-msg.js +++ b/lib/render-msg.js @@ -862,6 +862,16 @@ function asNpmReadme(readme) { return u.ifString(readme) } +function singleValue(obj) { + if (!obj || typeof obj !== 'object') return obj + var keys = Object.keys(obj) + if (keys.length === 1) return obj[keys[0]] +} + +function ifDifferent(obj, value) { + if (singleValue(obj) !== value) return obj +} + RenderMsg.prototype.npmPublish = function (cb) { var self = this var render = self.render @@ -898,7 +908,7 @@ RenderMsg.prototype.npmPublish = function (cb) { versions.map(function (version, i) { var release = pkg.versions[version] || {} var license = u.ifString(release.license) - var author = release.author + var author = ifDifferent(release.author, self.msg.value.author) var description = u.ifString(release.description) var readme = asNpmReadme(release.readme) var keywords = u.toArray(release.keywords).map(u.ifString) |