Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
profile.getAttributesList().forEach((attribute) => {
if (attribute.getName().includes(':')) {
// Derived attributes are handled separately.
return;
}
switch (attribute.getName()) {
case constants.ATTR_SELFIE:
case constants.ATTR_FULL_NAME:
// Handled separately.
break;
case constants.ATTR_FAMILY_NAME:
attributes.push(createAttributeItem(attribute, 'Family names', 'yoti-icon-profile'));
break;
case constants.ATTR_GIVEN_NAMES:
attributes.push(createAttributeItem(attribute, 'Given names', 'yoti-icon-profile'));
break;
case constants.ATTR_DATE_OF_BIRTH:
attributes.push(createAttributeItem(attribute, 'Date of birth', 'yoti-icon-calendar'));
break;
case constants.ATTR_GENDER:
attributes.push(createAttributeItem(attribute, 'Gender', 'yoti-icon-gender'));
break;
case constants.ATTR_NATIONALITY:
attributes.push(createAttributeItem(attribute, 'Nationality', 'yoti-icon-profile'));
break;
case constants.ATTR_PHONE_NUMBER:
attributes.push(createAttributeItem(attribute, 'Mobile number', 'yoti-icon-phone'));