<commit_before>import { req, withParams } from './common'

export default (separator = ':') =>
  withParams({ type: 'macAddress' }, (value) => {
    if (!req(value)) {
      return true
    }

    if (typeof value !== 'string') {
      return false
    }

    const parts =
      typeof separator === 'string' && separator !== ''
        ? value.split(separator)
        : value.length === 12 || value.length === 16
        ? value.match(/.{2}/g)
        : null

    return (
      parts !== null &&
      (parts.length === 6 || parts.length === 8) &&
      parts.every(hexValid)
    )
  })

const hexValid = (hex) => hex.toLowerCase().match(/^[0-9a-f]{2}$/)<commit_msg>chore: revert macAddress change<commit_after>import { req, withParams } from './common'

export default (separator = ':') =>
  withParams({ type: 'macAddress' }, (value) => {
    if (!req(value)) {
      return true
    }

    if (typeof value !== 'string') {
      return false
    }

    const parts =
      typeof separator === 'string' && separator !== ''
        ? value.split(separator)
        : value.length === 12 || value.length === 16
          ? value.match(/.{2}/g)
          : null

    return (
      parts !== null &&
      (parts.length === 6 || parts.length === 8) &&
      parts.every(hexValid)
    )
  })

const hexValid = (hex) => hex.toLowerCase().match(/^[0-9a-f]{2}$/)
{'fraction_non_alphanumeric': 0.19309838472834068, 'fraction_numerical': 0.014684287812041116, 'mean_word_length': 2.2607655502392343, 'pattern_counts': {'":': 0, '<': 3, '<?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': '1181547', 'n_tokens_mistral': 448, 'n_tokens_neox': 420, 'n_words': 96}