Advertisement
Guest User

Untitled

a guest
Feb 1st, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const latinDataFormating = (firstName, lastName) => {
  2.     firstName = firstName.trim();
  3.     lastName = lastName.trim();
  4.     if (firstName.length + lastName.length > 25) {
  5.         firstName = firstName[0];
  6.     }
  7.     if (lastName.indexOf('-') && firstName.length + lastName.length > 25) {
  8.         lastName = lastName.slice(0, lastName.indexOf('-'));
  9.     }
  10.     if (firstName.length + lastName.length > 25){
  11.         lastName = lastName.slice(0,24);
  12.     }
  13.     return {firstName, lastName};
  14. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement