<commit_before>

function decode(plainText) {
  
}<commit_msg>Adding Code for Rot13 decode function.<commit_after>

function Rot13() {

  this.decode = function(plainText) {

    if (!stringIsValid(plainText)) {
      return null;
    }

    return plainText.toUpperCase().split('').map(function(currentChar) {
      if (currentChar.match('^[a-zA-Z]+$') == null) {
        return currentChar;
      }

      return String.fromCharCode(calculateCode(currentChar));
    }).reduce(function(previousValue, currentChar) {
      return previousValue + currentChar;
    });
  }

  function stringIsValid(text) {
    return typeof text === 'string' && text.length !== 0;
  }

  function calculateCode(char) {
    var firstUpperCode = 'A'.charCodeAt(0);
    var lastUpperCode = 'Z'.charCodeAt(0) + 1;

    var decoded = char.charCodeAt(0) - 13;

    if (firstUpperCode > decoded) {
      decoded = lastUpperCode - (firstUpperCode - decoded);
    }

    return decoded;
  }

}
{'fraction_non_alphanumeric': 0.13768115942028986, 'fraction_numerical': 0.011387163561076604, 'mean_word_length': 3.2043478260869565, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2740553', 'n_tokens_mistral': 324, 'n_tokens_neox': 300, 'n_words': 61}