Style: format contact label helper
This commit is contained in:
committed by
Peter Steinberger
parent
77c7387bbd
commit
18338bc60f
@@ -820,8 +820,7 @@ function formatContactLabel(
|
|||||||
}
|
}
|
||||||
|
|
||||||
function formatPhoneList(phones?: string[]): string | undefined {
|
function formatPhoneList(phones?: string[]): string | undefined {
|
||||||
const cleaned =
|
const cleaned = phones?.map((phone) => phone.trim()).filter(Boolean) ?? [];
|
||||||
phones?.map((phone) => phone.trim()).filter(Boolean) ?? [];
|
|
||||||
if (cleaned.length === 0) return undefined;
|
if (cleaned.length === 0) return undefined;
|
||||||
const [primary, ...rest] = cleaned;
|
const [primary, ...rest] = cleaned;
|
||||||
if (!primary) return undefined;
|
if (!primary) return undefined;
|
||||||
|
|||||||
Reference in New Issue
Block a user