<commit_before>var path = require("path");

module.exports = {
  "title": prompt("title", "My Jetpack Addon", identity),
  "name": prompt("name", path.basename(process.cwd()), sanitizeName),
  "version": prompt("version", "0.0.0", function (ver) {
  }),
  "description": prompt("description", "", identity),
  "main": prompt("entry point", "index.js", identity),
  "author": prompt("author", "", identity),
  "license": prompt("license", "MIT", identity)
};

/**
 * Returns the argument passed into it.
 *
 * @param {Mixed} x
 * @return {Mixed}
 */

function identity (x) {
  return x;
}

/**
 * Takes a string and filters out anything that is not
 * a letter, number, or dash (-) and casts to lower case.
 *
 * @param {String} name
 * @return {String}
 */

function sanitizeName (name) {
  name = name || "";
  return name.replace(/[^\w-]|_/g,'').toLowerCase();
}

/**
 * Takes a version string ('1.0.4') and ensures it is a valid semver
 * string. Does not accept ambiguous semver strings like '>= 0.4.x', and
 * the like.
 *
 * @param {String} version
 * @return {String}
 */

function sanitizeVersion (ver) {
  if (/^\d+\.\d+\.\d+$/.test(ver))
    return ver;
  return "0.0.0";
}<commit_msg>Add engines to jpm init<commit_after>var path = require("path");

module.exports = {
  "title": prompt("title", "My Jetpack Addon", identity),
  "name": prompt("name", path.basename(process.cwd()), sanitizeName),
  "version": prompt("version", "0.0.0", sanitizeVersion),
  "description": prompt("description", "", identity),
  "main": prompt("entry point", "index.js", identity),
  "author": prompt("author", "", identity),
  "engines": prompt("engines (comma separated)", "firefox,fennec", splitObject),
  "license": prompt("license", "MIT", identity)
};

/**
 * Returns the argument passed into it.
 *
 * @param {Mixed} x
 * @return {Mixed}
 */

function identity (x) {
  return x;
}

/**
 * Takes a string and filters out anything that is not
 * a letter, number, or dash (-) and casts to lower case.
 *
 * @param {String} name
 * @return {String}
 */

function sanitizeName (name) {
  name = name || "";
  return name.replace(/[^\w-]|_/g,'').toLowerCase();
}

/**
 * Takes a version string ('1.0.4') and ensures it is a valid semver
 * string. Does not accept ambiguous semver strings like '>= 0.4.x', and
 * the like.
 *
 * @param {String} version
 * @return {String}
 */

function sanitizeVersion (ver) {
  if (/^\d+\.\d+\.\d+$/.test(ver))
    return ver;
  return "0.0.0";
}

/**
 * Takes a comma-separated string and returns an object with each
 * value in the string a property of the object with a '*' value
 *
 * @param {String} input
 * @return {Object}
 */

function splitObject (input) {
  return input.split(',').reduce(function (obj, value) {
    obj[value] = "*";
    return obj;
  }, {});
}
{'fraction_non_alphanumeric': 0.1930074919728862, 'fraction_numerical': 0.00784873349982162, 'mean_word_length': 3.744500846023689, 'pattern_counts': {'":': 15, '<': 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': '6391227', 'n_tokens_mistral': 938, 'n_tokens_neox': 925, 'n_words': 286}