<commit_before>/* Copyright (c) 2012 <NAME> */

var errmsg = "mstring: required format is function (){/*** ... ***/}, this is invalid: "

module.exports = function(f){
  if( !_.isFunction(f) ) {
    throw new Error(errmsg+f)
  }

  var fs = f.toString()
  var m  = fs.match(/^function\s*\(\)\s*\{\s*\/\*\*\*\n([\s\S]*)\n\*\*\*\/\s*\}$/) 
  if( m && _.isString(m[1]) ) {
    return m[1]
  }
  else throw new Error(errmsg+f);
}

<commit_msg>fix regex for fn body with \n* qualifiers<commit_after>/* Copyright (c) 2012 <NAME> */

var errmsg = "mstring: required format is function (){/*** ... ***/}, this is invalid: "

module.exports = function(f){
  if( !_.isFunction(f) ) {
    throw new Error(errmsg+f)
  }

  var fs = f.toString()
  var m  = fs.match(/^function\s*\(\)\s*\{\s*\/\*\*\*\n*([\s\S]*)\n*\*\*\*\/\s*\}$/);
  
  if( m && _.isString(m[1]) ) {
    return m[1]
  }
  else throw new Error(errmsg+f);
}


{'fraction_non_alphanumeric': 0.2667398463227223, 'fraction_numerical': 0.013172338090010977, 'mean_word_length': 2.6923076923076925, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '4897177', 'n_tokens_mistral': 382, 'n_tokens_neox': 361, 'n_words': 81}