UNPKG

@zohodesk/components

Version:

Dot UI is a customizable React component library built to deliver a clean, accessible, and developer-friendly UI experience. It offers a growing set of reusable components designed to align with modern design systems and streamline application development

13 lines (11 loc) 493 B
function constructFullName(firstName, lastName) { return `${firstName ? `${firstName}${lastName ? ' ' : ''}` : ''}${lastName ? lastName : ''}`; } export function constructFullNameByPattern(firstName, lastName, namePattern) { let [name0, name1] = namePattern; if (name0 === 'FIRST_NAME' && name1 === 'LAST_NAME') { return constructFullName(firstName, lastName); } else if (name0 === 'LAST_NAME' && name1 === 'FIRST_NAME') { return constructFullName(lastName, firstName); } }