<commit_before>import * as React from "react"

function getDisplayName<P>(Component: React.StatelessComponent<P>): string {
  return Component.displayName || Component.name || "Unknown"
}

const functionWrapper = function<P>(
  functionalComponent: React.StatelessComponent<P>
): React.ComponentClass<P> {
  return class extends React.Component<P, {}> {
    static displayName = getDisplayName(functionalComponent)
    render() {
      return functionalComponent(this.props)
    }
  }
}

export default functionWrapper<commit_msg>fix: trying to get better test coverage by refactoring<commit_after>import * as React from "react"

const functionWrapper = function<P>(
  Component: React.StatelessComponent<P>
): React.ComponentClass<P> {
  class Wrapper extends React.Component<P, {}> {
    render() {
      return Component(this.props)
    }
  }
  Wrapper.displayName = Component.displayName || Component.name || "Unknown"
  return Wrapper
}

export default functionWrapper
{'fraction_non_alphanumeric': 0.1079136690647482, 'fraction_numerical': 0.0, 'mean_word_length': 4.975460122699387, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '775005', 'n_tokens_mistral': 273, 'n_tokens_neox': 270, 'n_words': 66}