<commit_before>'use strict';
let algorithms = {};

function isLower(char) {
  return char >= 0x61 /* 'a' */ && char <= 0x7a /* 'z' */;
}

function isUpper(char) {
  return char >= 0x41 /* 'A' */ && char <= 0x5a /* 'Z' */;
}

function isDigit(char) {
  return char >= 0x30 /* '0' */ && char <= 0x39 /* '9' */;
}

function toUpper(char) {
  return char - 0x20;
}

function toUpperSafe(char) {
  if(isLower((char))) {
    return char - 0x20;
  }
  return char;
}

function toLower(char) {
  return char + 0x20;
}

algorithms.camelize = function(str) {
  let firstChar = str.charCodeAt(0);
  if(isDigit(firstChar) || firstChar == 0x2d /* '-' */) {
    return str;
  }
  let length = str.length;
  let changed = false;
  let out = [];
  for(let i = 0; i < length; ++i) {
    let c = str.charCodeAt(i);
    if(c === 0x5f /* '_' */ || c === 0x20 /* ' ' */ || c == 0x2d /* '-' */ ) {
      changed = true;
      c = str.charCodeAt(++i);
      if(isNaN(c)) {
        return str;
      }
      out.push(toUpperSafe(c))
    } else if(i === 0 && isUpper(c)) {
      changed = true;
      out.push(toLower(c));
    } else {
      out.push(c);
    }
  }
  return changed ? String.fromCharCode.apply(undefined, out) : str;
};<commit_msg>Make js version as fast as native<commit_after>'use strict';
let algorithms = {};

function isLower(char) {
  return char >= 0x61 /* 'a' */ && char <= 0x7a /* 'z' */;
}

function isUpper(char) {
  return char >= 0x41 /* 'A' */ && char <= 0x5a /* 'Z' */;
}

function isDigit(char) {
  return char >= 0x30 /* '0' */ && char <= 0x39 /* '9' */;
}

function toUpper(char) {
  return char - 0x20;
}

function toUpperSafe(char) {
  if(isLower((char))) {
    return char - 0x20;
  }
  return char;
}

function toLower(char) {
  return char + 0x20;
}

algorithms.camelize = function(str) {
  let firstChar = str.charCodeAt(0);
  if(isDigit(firstChar) || firstChar == 0x2d /* '-' */) {
    return str;
  }
  let out = [];
  let changed = false;
  if(isUpper(firstChar)) {
    changed = true;
    out.push(toLower(firstChar));
  } else {
    out.push(firstChar);
  }
  
  let length = str.length;
  for(let i = 1; i < length; ++i) {
    let c = str.charCodeAt(i);
    if(c === 0x5f /* '_' */ || c === 0x20 /* ' ' */ || c == 0x2d /* '-' */ ) {
      changed = true;
      c = str.charCodeAt(++i);
      if(isNaN(c)) {
        return str;
      }
      out.push(toUpperSafe(c))
    } else {
      out.push(c);
    }
  }
  return changed ? String.fromCharCode.apply(undefined, out) : str;
};
{'fraction_non_alphanumeric': 0.1996798719487795, 'fraction_numerical': 0.03081232492997199, 'mean_word_length': 2.481894150417827, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, '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': '3149606', 'n_tokens_mistral': 1025, 'n_tokens_neox': 979, 'n_words': 213}