Skip to content
Permalink
Browse files

fix: Properly map over user.copyright

  • Loading branch information
Richienb committed Nov 26, 2019
1 parent 8ff508a commit 7f6a8d5dd9ae499c0f72b32c1937a0cdcb7c2d23
Showing with 3 additions and 3 deletions.
  1. +3 −3 routes/get.js
@@ -36,10 +36,10 @@ module.exports = (req, res) => {
if (user.copyright) {
if (_.isString(user.copyright)) {
name = getCopyrightHTML(user, options.format !== 'html');
} else if (user.copyright.every(val => _.isString(val))) {
} else if (_.isArray(user.copyright) && user.copyright.every(val => _.isString(val))) {
// Supports: ['Remy Sharp', 'Richie Bendall']
name = user
.map(_ => (options.format !== 'html' ? _ : escapeTags(_)))
name = user.copyright
.map(v => (options.format !== 'html' ? v : escapeTags(v)))
.join(', ');
} else {
name = user.copyright.map(getCopyrightHTML).join(', ');

0 comments on commit 7f6a8d5

Please sign in to comment.
You can’t perform that action at this time.