mirror of
https://github.com/samsonjs/mit-license.git
synced 2026-04-27 15:07:42 +00:00
fix: Properly map over user.copyright
This commit is contained in:
parent
8ff508a547
commit
7f6a8d5dd9
1 changed files with 3 additions and 3 deletions
|
|
@ -36,10 +36,10 @@ module.exports = (req, res) => {
|
||||||
if (user.copyright) {
|
if (user.copyright) {
|
||||||
if (_.isString(user.copyright)) {
|
if (_.isString(user.copyright)) {
|
||||||
name = getCopyrightHTML(user, options.format !== 'html');
|
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']
|
// Supports: ['Remy Sharp', 'Richie Bendall']
|
||||||
name = user
|
name = user.copyright
|
||||||
.map(_ => (options.format !== 'html' ? _ : escapeTags(_)))
|
.map(v => (options.format !== 'html' ? v : escapeTags(v)))
|
||||||
.join(', ');
|
.join(', ');
|
||||||
} else {
|
} else {
|
||||||
name = user.copyright.map(getCopyrightHTML).join(', ');
|
name = user.copyright.map(getCopyrightHTML).join(', ');
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue