<commit_before>const { merge } = require('lodash');
const { match } = require('posthtml/lib/api');
const matchHelper = require('posthtml-match-helper');

const { name: packageName } = require('../package.json');

const { normalizeRules } = require('./utils');

const defaultConfig = {
  skipRootTag: false,
  convertAlphaColors: false
};

module.exports = (rules, config = {}) => {
  const cfg = merge(defaultConfig, config);

  if (typeof rules !== 'string' && !Array.isArray(rules)) {
    throw new Error(`${packageName}: rules should be \`Array<Object>|string\``);<commit_msg>chore: convert alpha colors by default<commit_after>const { merge } = require('lodash');
const { match } = require('posthtml/lib/api');
const matchHelper = require('posthtml-match-helper');

const { name: packageName } = require('../package.json');

const { normalizeRules } = require('./utils');

const defaultConfig = {
  skipRootTag: false,
  convertAlphaColors: true
};

module.exports = (rules, config = {}) => {
  const cfg = merge(defaultConfig, config);

  if (typeof rules !== 'string' && !Array.isArray(rules)) {
    throw new Error(`${packageName}: rules should be \`Array<Object>|string\``);
{'fraction_non_alphanumeric': 0.1785109983079526, 'fraction_numerical': 0.0, 'mean_word_length': 4.974747474747475, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '3618495', 'n_tokens_mistral': 352, 'n_tokens_neox': 351, 'n_words': 86}