Advertisement
Guest User

Untitled

a guest
Feb 21st, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. contentBlock.characterList.reduce((characterList, character) => {
  2.  
  3.   const previousCharacter = characterList.last();
  4.  
  5.   if (character.entity.type === previousCharacter.entity.type
  6.       && character.entity !== previousCharacter.entity) {
  7.    
  8.     Entity.mergeData(previousCharacter.entity, character.entity.end);
  9.  
  10.     return characterList.push(
  11.       CharacterMetadata.applyEntity(character, previousCharacter.entity)
  12.     );
  13.  
  14.   } else {
  15.    
  16.     return characterList.push(character);
  17.  
  18.   }
  19.  
  20. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement