The author's name was duplicated

This commit is contained in:
Artur
2025-11-21 12:28:27 +03:00
parent 87e7e18bc5
commit d95aa0ac8a
3 changed files with 20 additions and 8 deletions

View File

@ -466,6 +466,18 @@ CitationItemData.prototype.fillFromObject = function (itemDataObject) {
if (creator.lastName) {
author.family = creator.lastName;
}
let bHasAuthor = self._author.some(function (a) {
if (a.family !== author.family && (a.family || author.family)) {
return false;
}
if (a.given !== author.given && (a.given || author.given)) {
return false;
}
return true;
});
if (bHasAuthor) {
return;
}
self._author.push(author);
},
this);

View File

@ -11,6 +11,14 @@
* @property {boolean} [`suppress-author`]
*/
/**
* @typedef {Object} InfoForCitationCluster
* @property {string|number} id
* @property {boolean} `suppress-author`
* @property {string} [prefix]
* @property {string} [suffix]
*/
/**
* @param {string|number} id
*/

View File

@ -1,14 +1,6 @@
// @ts-check
/// <reference path="./citation-item.js" />
/**
* @typedef {Object} InfoForCitationCluster
* @property {string|number} id
* @property {boolean} `suppress-author`
* @property {string} [prefix]
* @property {string} [suffix]
*/
/**
* @typedef {Object} CitationJsonData
* @property {string} key