<commit_before>module.exports = {
  required: function (props) {
    let {value} = props.valueLink
    // if there is a null option then null is a valid value and there are not
    // any values for which required should return an error
    if ((props.options || []).filter((o) => o.value == null).length > 0) {
      return undefined
    }
    if (value != null && value !== '') return undefined
    return 'This field is required.'
  },

  min: function (props, opts) {
    let {value} = props.valueLink
    if (value >= opts || value == null || value === '') return undefined
    return `Value cannot be less than ${opts}`
  },

  max: function (props, opts) {
    let {value} = props.valueLink
    if (value <= opts || value == null || value === '') return undefined
    return `Value cannot be greater than ${opts}`
  },
}<commit_msg>eslint src/validations.js<commit_after>module.exports = {
  required(props) {
    const { value } = props.valueLink
    // if there is a null option then null is a valid value and there are not
    // any values for which required should return an error
    if ((props.options || []).filter((o) => o.value == null).length > 0) {
      return undefined
    }
    if (value != null && value !== "") return undefined
    return "This field is required."
  },

  min(props, opts) {
    const { value } = props.valueLink
    if (value >= opts || value == null || value === "") return undefined
    return `Value cannot be less than ${opts}`
  },

  max(props, opts) {
    const { value } = props.valueLink
    if (value <= opts || value == null || value === "") return undefined
    return `Value cannot be greater than ${opts}`
  },
}
{'fraction_non_alphanumeric': 0.1431995206710605, 'fraction_numerical': 0.0011983223487118035, 'mean_word_length': 2.847926267281106, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '4075532', 'n_tokens_mistral': 472, 'n_tokens_neox': 468, 'n_words': 189}