This commit is contained in:
2025-11-02 04:40:07 +01:00
parent f7b274c1ec
commit e7e7881772
13 changed files with 560 additions and 243 deletions
+7 -7
View File
@@ -6,14 +6,14 @@ export const resolveCorrespondents = (doc) => {
const seen = new Set();
const results = [];
doc.correspondents.forEach((entry, index) => {
if (!entry || typeof entry.name !== 'string') {
doc.correspondents.forEach((entry = {}, index) => {
const { id, name } = entry;
if (typeof name !== 'string') {
return;
}
const id = entry.id;
const name = entry.name.trim();
if (!name) {
const trimmedName = name.trim();
if (!trimmedName) {
return;
}
@@ -27,8 +27,8 @@ export const resolveCorrespondents = (doc) => {
results.push({
id,
name,
key: id ?? `${name}-${index}`,
name: trimmedName,
key: id ?? `${trimmedName}-${index}`,
});
});