code: function isSoftNewlineEvent(event: Object): boolean {
    return (
      event.which === 13 &&
      (event.getModifierState('Shift') ||
        event.getModifierState('Alt') ||
        event.getModifierState('Control'))
    );
  }
docs: Function to check is event was soft-newline
  taken from : https://github.com/facebook/draft-js/blob/master/src/component/utils/isSoftNewlineEvent.js