react-code-dataset / wp-calypso /client /site-profiler /utils /normalize-whois-entry.ts
Devendra174's picture
Upload folder using huggingface_hub
1e92f2d verified
Raw History Blame Contribute Delete
236 Bytes
// Normalize a whois entry field to a string
export function normalizeWhoisField( field: string | string[] | undefined ): string {
if ( Array.isArray( field ) ) {
return field.length > 0 ? field[ 0 ] : '';
}
return field ?? '';
}