<commit_before>import _ from 'lodash';
import invariant from 'invariant';

/**
 * Utility function to create object of constants
 *
 * Example:
 *
 * 	createConstants(['A', 'B'])
 * 	=
 * 	{
 * 		A: 'A',
 * 		B: 'B'
 * 	}
 *
 *
 * 	createConstants(['A', 'B'], 'prefix-')
 * 	=
 * 	{
 * 		A: 'prefix-A',
 * 		B: 'prefix-B'
 * 	}
 *
 * @param constants
 * @param prefix
 * @returns {*}
 */
export default function createConstants(constants, prefix) {
	invariant(_.isArray(constants), 'First argument of `createConstants` should be array of strings - names of constants.');
	invariant(_.isUndefined(prefix) || _.isString(prefix), 'Second optional argument of `createConstants` should be a string prefix to prepend to all constant values.');<commit_msg>chore: deprecate createConstants.<commit_after>import _ from 'lodash';
import invariant from 'invariant';

/**
 * @deprecated Constants should be declared as true es6 constants to allow static analysis of code
 * Utility function to create object of constants
 *
 * Example:
 *
 * 	createConstants(['A', 'B'])
 * 	=
 * 	{
 * 		A: 'A',
 * 		B: 'B'
 * 	}
 *
 *
 * 	createConstants(['A', 'B'], 'prefix-')
 * 	=
 * 	{
 * 		A: 'prefix-A',
 * 		B: 'prefix-B'
 * 	}
 *
 * @param constants
 * @param prefix
 * @returns {*}
 */
export default function createConstants(constants, prefix) {
	invariant(_.isArray(constants), 'First argument of `createConstants` should be array of strings - names of constants.');
	invariant(_.isUndefined(prefix) || _.isString(prefix), 'Second optional argument of `createConstants` should be a string prefix to prepend to all constant values.');
{'fraction_non_alphanumeric': 0.15213358070500926, 'fraction_numerical': 0.0006184291898577613, 'mean_word_length': 3.858858858858859, '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': '4124471', 'n_tokens_mistral': 532, 'n_tokens_neox': 523, 'n_words': 154}