<commit_before>import { withProps } from 'recompose';
import isNil from 'lodash.isnil';

const injectFeatureToggle = (flagName, propKey = 'isFeatureEnabled') =>
  withProps(props => {
    const flagValue = props.availableFeatureToggles[flagName];

    return { [propKey]: isNil(flagValue) ? false : flagValue };
  });

export default injectFeatureToggle;<commit_msg>refactor(react): to use defaultFlagName constant<commit_after>import { withProps } from 'recompose';
import isNil from 'lodash.isnil';
import { defaultFlagName } from '../helpers/is-feature-enabled';

const injectFeatureToggle = (flagName, propKey = defaultFlagName) =>
  withProps(props => {
    const flagValue = props.availableFeatureToggles[flagName];

    return { [propKey]: isNil(flagValue) ? false : flagValue };
  });

export default injectFeatureToggle;
{'fraction_non_alphanumeric': 0.12062726176115803, 'fraction_numerical': 0.0, 'mean_word_length': 5.64, 'pattern_counts': {'":': 0, '<': 3, '<?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': '4902992', 'n_tokens_mistral': 245, 'n_tokens_neox': 240, 'n_words': 57}