<commit_before>import _curry2 from './internal/_curry2'

/**
 * add : (a -> b) -> [a] -> [b]
 *
 * @description
 * Applies a transformation to every item in an array, returning a new
 * array of the same size where each item has been transformed.
 *
 * @when
 * You should use this function when you wish to apply a common transformation
 * to every item in an array. For example, if you have an array of objects
 * and want a new array containing only a certain property from each object.
 *
 * @example
 * _.map((a) => a + 5, [1,2,3,4,5]) // [6,7,8,9,10]
 *
 * @example
 * _.map((a) => a.id, [{ id: 1 }, { id: 2 }, { id: 3 }]) // [1,2,3]
 *
 * @example
 * const add5 = _.add(5)
 * const mapAdd5 = _.map(add5)
 * mapAdd5([1,2,3,4]) // [6,7,8,9]
 */
var map = _curry2(function map (fn, xs) {
  var i   = 0
    , len = xs.length
    , ys  = new Array(len)

  for (; i < len; i++) {
    ys[i] = fn(xs[i], i)
  }
  return ys
})

export default map<commit_msg>refactor(map): do not provide index argument<commit_after>import _curry2 from './internal/_curry2'

/**
 * add : (a -> b) -> [a] -> [b]
 *
 * @description
 * Applies a transformation to every item in an array, returning a new
 * array of the same size where each item has been transformed.
 *
 * @when
 * You should use this function when you wish to apply a common transformation
 * to every item in an array. For example, if you have an array of objects
 * and want a new array containing only a certain property from each object.
 *
 * @example
 * _.map((a) => a + 5, [1,2,3,4,5]) // [6,7,8,9,10]
 *
 * @example
 * _.map((a) => a.id, [{ id: 1 }, { id: 2 }, { id: 3 }]) // [1,2,3]
 *
 * @example
 * const add5 = _.add(5)
 * const mapAdd5 = _.map(add5)
 * mapAdd5([1,2,3,4]) // [6,7,8,9]
 */
var map = _curry2(function map (fn, xs) {
  var i   = 0
    , len = xs.length
    , ys  = new Array(len)

  for (; i < len; i++) {
    ys[i] = fn(xs[i])
  }
  return ys
})

export default map
{'fraction_non_alphanumeric': 0.16907216494845362, 'fraction_numerical': 0.03608247422680412, 'mean_word_length': 2.8435643564356434, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '1291552', 'n_tokens_mistral': 744, 'n_tokens_neox': 721, 'n_words': 255}