<commit_before>import slash from "slash";
import * as util from "../../../util";

/**
 * Get a transformer list from a value.
 */

export function transformerList(val) {
  return util.arrayify(val);
}

/**
 * Validate transformer list. Maps "all" to all transformer names.
 */

transformerList.validate = function (key, val, pipeline) {
  if (val.indexOf("all") >= 0 || val.indexOf(true) >= 0) {
    val = Object.keys(pipeline.transformers);
  }

  return pipeline._ensureTransformerNames(key, val);
};

/**
 * Cast a value to a number.
 */

export function number(val) {
  return +val;
}

/**
 * Cast a value to a boolean.
 */

export var filename = slash;

export function boolean(val) {
  return !!val;
}

/**
 * Cast a boolean-like string to a boolean.
 */

export function booleanString(val) {
  return util.booleanify(val);
}

/**
 * Cast a value to an array, splitting strings by ",".
 */

export function list(val) {
  return util.list(val);
}<commit_msg>remove transformerList option parser and remove redundant comments<commit_after>import slash from "slash";
import * as util from "../../../util";

export function number(val) {
  return +val;
}

export var filename = slash;

export function boolean(val) {
  return !!val;
}

export function booleanString(val) {
  return util.booleanify(val);
}

export function list(val) {
  return util.list(val);
}
{'fraction_non_alphanumeric': 0.1438004402054292, 'fraction_numerical': 0.001467351430667645, 'mean_word_length': 3.639455782312925, 'pattern_counts': {'":': 0, '<': 3, '<?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': '531154', 'n_tokens_mistral': 433, 'n_tokens_neox': 420, 'n_words': 137}