@zohodesk/components
Version:
In this Package, we Provide Some Basic Components to Build Web App
13 lines (11 loc) • 493 B
JavaScript
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);
}
}