<commit_before>import React from 'react'

const FieldErrorList = props => {
  if (!props.errors) {
    return null
  }

  let errorValues = []
  Object.keys(props.errors).map(key => {
    errorValues = [...errorValues, ...props.errors[key]]
  })

  return (
    <ul className="error-list">
      {errorValues.map((value, idx) => (
        <li key={idx}>{value}</li>
      ))}
    </ul>
  )
}

FieldErrorList.propTypes = {
  errors: React.PropTypes.objectOf(
    React.PropTypes.arrayOf(React.PropTypes.string)
  ).isRequired
}

export default FieldErrorList
<commit_msg>refactor(entity-browser): better array loop in ErrorList<commit_after>import React from 'react'

const FieldErrorList = props => {
  if (!props.errors) {
    return null
  }

  const errorValues = []
  Object.keys(props.errors).forEach(key => {
    errorValues.push(...props.errors[key])
  })

  return (
    <ul className="error-list">
      {errorValues.map((value, idx) => (
        <li key={idx}>{value}</li>
      ))}
    </ul>
  )
}

FieldErrorList.propTypes = {
  errors: React.PropTypes.objectOf(
    React.PropTypes.arrayOf(React.PropTypes.string)
  ).isRequired
}

export default FieldErrorList

{'fraction_non_alphanumeric': 0.15659574468085105, 'fraction_numerical': 0.0, 'mean_word_length': 3.2, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 17, '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': '4940448', 'n_tokens_mistral': 395, 'n_tokens_neox': 395, 'n_words': 69}