title: Switch case where I want to do some things if case A OR B and other things if case A XOR B?
body: <p>Look at this switch case statement. Cases 'response' and 'error' have a lot in common, but also one line that tells them apart.</p>
  
  <pre><code>            switch (data.type) {
                  case 'response':
                      const transactionId = data.trans_id;
                      const callbacks = commandCallbacks[transactionId];
  
                      if (!callbacks) {
                          if (logger) logger(`Dropping received message that was not requested, transactionId: ${transactionId}`);
                          break;
                      }
  
                      clearTimeout(callbacks.timedOutTimer);
                      callbacks.resolver(data);
                      break;
                  case 'error':                
                      const transactionId = data.trans_id;
                      const callbacks = commandCallbacks[transactionId];
  
                      if (!callbacks) {
                          if (logger) logger(`Dropping received message that was not requested, transactionId: ${transactionId}`);
                          break;
                      }
  
                      clearTimeout(callbacks.timedOutTimer);
                      callbacks.rejecter(data);
                      break;
                  case 'information':
                  case 'progress':
                  default:
                      break;
              }
  </code></pre>
  
  <p>How can I simplify this code?</p>