<commit_before>import ProxyPreset from './proxy';
import StatsPreset from './stats';
import ExpBaseWithPaddingPreset from './exp-base-with-padding';
import ExpBaseAuthStreamPreset from './exp-base-auth-stream';
import SsBasePreset from './ss-base';
import SsStreamCipherPreset from './ss-stream-cipher';
import SsAeadCipherPreset from './ss-aead-cipher';
import AeadRandomCipherPreset from './aead-random-cipher';
import ObfsHttpPreset from './obfs-http';
import ObfsTls12TicketPreset from './obfs-tls1.2-ticket';

const mapping = {
  'proxy': ProxyPreset,
  'stats': StatsPreset,
  'exp-base-with-padding': ExpBaseWithPaddingPreset,
  'exp-base-auth-stream': ExpBaseAuthStreamPreset,
  'ss-base': SsBasePreset,
  'ss-stream-cipher': SsStreamCipherPreset,
  'ss-aead-cipher': SsAeadCipherPreset,
  'aead-random-cipher': AeadRandomCipherPreset,
  'obfs-http': ObfsHttpPreset,
  'obfs-tls1.2-ticket': ObfsTls12TicketPreset
};

function getPresetClassByName(name) {
  const clazz = mapping[name];
  if (clazz === undefined) {
    throw Error(`cannot find preset: "${name}"`);
  }
  return clazz;
}

export {getPresetClassByName};<commit_msg>presets: export preset names in index.js<commit_after>import ProxyPreset from './proxy';
import StatsPreset from './stats';
import ExpBaseWithPaddingPreset from './exp-base-with-padding';
import ExpBaseAuthStreamPreset from './exp-base-auth-stream';
import SsBasePreset from './ss-base';
import SsStreamCipherPreset from './ss-stream-cipher';
import SsAeadCipherPreset from './ss-aead-cipher';
import AeadRandomCipherPreset from './aead-random-cipher';
import ObfsHttpPreset from './obfs-http';
import ObfsTls12TicketPreset from './obfs-tls1.2-ticket';

const mapping = {
  'proxy': ProxyPreset,
  'stats': StatsPreset,
  'exp-base-with-padding': ExpBaseWithPaddingPreset,
  'exp-base-auth-stream': ExpBaseAuthStreamPreset,
  'ss-base': SsBasePreset,
  'ss-stream-cipher': SsStreamCipherPreset,
  'ss-aead-cipher': SsAeadCipherPreset,
  'aead-random-cipher': AeadRandomCipherPreset,
  'obfs-http': ObfsHttpPreset,
  'obfs-tls1.2-ticket': ObfsTls12TicketPreset
};

function getPresetClassByName(name) {
  const clazz = mapping[name];
  if (clazz === undefined) {
    throw Error(`cannot find preset: "${name}"`);
  }
  return clazz;
}

const presets = Object.keys(mapping);

export {getPresetClassByName, presets};
{'fraction_non_alphanumeric': 0.13951509995746492, 'fraction_numerical': 0.006805614632071459, 'mean_word_length': 5.426229508196721, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5750254', 'n_tokens_mistral': 858, 'n_tokens_neox': 839, 'n_words': 166}