<commit_before>import { getFootures } from './core';

const ALL_FEATURES: Array<string> = [];

function isEnabled(feature: string) {
  const specifier: object = getFootures();

  if (ALL_FEATURES.indexOf(feature) === -1) {
    // Not registered yet, 
    ALL_FEATURES.push(feature);
  }

  return !!specifier[feature];
}

/**
 * Register features. Allows the admin UI to be generated with checkboxes.
 *
 * @param {array} features An array of features spread out like a variadic function.
 */
function register(...features) {
  const specifier: object = getFootures();

  features.forEach((feature) => {
    if (ALL_FEATURES.indexOf(feature) === -1) {
      ALL_FEATURES.push(feature);
    }
  });
}

function getAllFootures() {
  return ALL_FEATURES;
}

// footures.isEnabled('foo') and footures.register('foo', 'bar');
export { register, isEnabled, getAllFootures };<commit_msg>Make API simpler, export a default footures object<commit_after>import { getFootures } from './core';

const ALL_FEATURES: Array<string> = [];

function isEnabled(feature: string) {
  const specifier: object = getFootures();

  if (ALL_FEATURES.indexOf(feature) === -1) {
    // Not registered yet, 
    ALL_FEATURES.push(feature);
  }

  return !!specifier[feature];
}

/**
 * Register features. Allows the admin UI to be generated with checkboxes.
 *
 * @param {array} features An array of features spread out like a variadic function.
 */
function register(...features) {
  const specifier: object = getFootures();

  features.forEach((feature) => {
    if (ALL_FEATURES.indexOf(feature) === -1) {
      ALL_FEATURES.push(feature);
    }
  });
}

function getAllFootures() {
  return ALL_FEATURES;
}

// footures.isEnabled('foo') and footures.register('foo', 'bar');
export default { register, isEnabled, getAllFootures };
export { register, isEnabled, getAllFootures };
{'fraction_non_alphanumeric': 0.14031300593631948, 'fraction_numerical': 0.0021586616297895305, 'mean_word_length': 4.135734072022161, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '2433804', 'n_tokens_mistral': 574, 'n_tokens_neox': 575, 'n_words': 152}