<commit_before>#     rivets.js
#     version : 0.1.10
#     author : <NAME>
#     license : MIT

# The Rivets namespace.
Rivets = {}
<commit_msg>Added polyfills for Array::map and String::trim<commit_after>#     rivets.js
#     version : 0.1.10
#     author : <NAME>
#     license : MIT

# The Rivets namespace.
Rivets = {}

# Polyfill For String::trim
unless String::trim
  String::trim = -> return @.replace(/^\s\*/, '').replace(/\s\s*$/, '')

# Polyfill For Array::map
unless Array::map
  Array::map = (callback) ->
    if this is null
      throw new TypeError "Can't convert #{this} to object"
    O = Object(this)
    len = O.length >>> 0

    throw new TypeError "#{callback} is not a function" unless typeof callback is 'function'

    T = arguments[1]
    A = new Array(len)
    k = 0;

    while k < len
      A[k] = callbackfn.call(T, O[k], k, O)  if k of O
      k++

    return A

{'fraction_non_alphanumeric': 0.15005599104143338, 'fraction_numerical': 0.012318029115341545, 'mean_word_length': 2.5476190476190474, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 10, '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': '1309075', 'n_tokens_mistral': 325, 'n_tokens_neox': 307, 'n_words': 97}