<commit_before>module.exports = function strcspn (str, mask, start, length) {
  //  discuss at: http://locutus.io/php/strcspn/
  // original by: <NAME> (http://brett-zamir.me)
  //   example 1: strcspn('abcdefg123', '1234567890')
  //   returns 1: 7
  //   example 2: strcspn('123abc', '1234567890')
  //   returns 2: 3

  start = start || 0
  var count = (length && ((start + length) < str.length)) ? start + length : str.length
  strct: for (var i = start, lgth = 0; i < count; i++) { // eslint-disable-line no-labels
    for (var j = 0; j < mask.length; j++) {
      if (str.charAt(i).indexOf(mask[j]) !== -1) {
        continue strct // eslint-disable-line no-labels
      }
    }
    ++lgth
  }

  return lgth<commit_msg>Fixed example #2 and start/length (#322)<commit_after>module.exports = function strcspn (str, mask, start, length) {
  //  discuss at: http://locutus.io/php/strcspn/
  // original by: <NAME> (http://brett-zamir.me)
  //  revised by: Theriault
  //   example 1: strcspn('abcdefg123', '1234567890')
  //   returns 1: 7
  //   example 2: strcspn('123abc', '1234567890')
  //   returns 2: 0
  //   example 3: strcspn('abcdefg123', '1234567890', 1)
  //   returns 3: 6
  //   example 4: strcspn('abcdefg123', '1234567890', -6, -5)
  //   returns 4: 1

  start = start || 0
  length = typeof length === 'undefined' ? str.length : (length || 0)
  if (start < 0) start = str.length + start
  if (length < 0) length = str.length - start + length
  if (start < 0 || start >= str.length || length <= 0 || e >= str.length) return 0
  var e = Math.min(str.length, start + length)
  for (var i = start, lgth = 0; i < e; i++) {
    if (mask.indexOf(str.charAt(i)) !== -1) {
      break
    }
    ++lgth
  }
  return lgth
{'fraction_non_alphanumeric': 0.17850953206239167, 'fraction_numerical': 0.06701328711727325, 'mean_word_length': 2.615866388308977, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 7, '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': '4197366', 'n_tokens_mistral': 743, 'n_tokens_neox': 651, 'n_words': 176}