/**
 * hasTailwindPrefix
 * Check if a class list contains a tailwind set of classes matching a prefix
 * @params prefix {string} A tailwind class prefix like bg, border, text
 * @params overrides {string} A string of css class names that contain overriding class names
 * @return {boolean}
 * @example hasTailWindPrefix('bg', 'bg-transparent border-current text-current')
 */
export default function hasTailwindPrefix(prefix, overrides) {
  const regex = new RegExp(`\\b${prefix}[-\\w]+`)
  return regex.test(overrides)
}