<commit_before>import { css } from '@styli/core'

export default {
  name: 'css',
  bind: function (el: HTMLElement, bind: any) {
    const props: any = {}

    for (const { name, value } of Object.values(el.attributes)) {
      props[name] = value === '' ? true : value
    }

    const value = bind.value || ''

    value.split(/\s+/).forEach((i) => {
      props[i] = true
    })

    const className = css(Object.keys(props).join(' '))
    if (className) el?.classList.add(...className.split(' '))
  },
}<commit_msg>feat: improve v-css directive<commit_after>import { css } from '@styli/core'

export default {
  name: 'css',
  bind: function (el: HTMLElement, bind: any) {
    const props: any = {}

    for (const { name, value } of Object.values(el.attributes)) {
      props[name] = value === '' ? true : value
    }

    const value = bind.value || ''

    value.split(/\s+/).forEach((i: any) => {
      props[i] = true
    })

    const className = css(Object.keys(props).join(' '))
    if (className) el?.classList.add(...className.split(' '))
  },
}
{'fraction_non_alphanumeric': 0.19132893496701225, 'fraction_numerical': 0.0, 'mean_word_length': 2.7928571428571427, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '3188017', 'n_tokens_mistral': 362, 'n_tokens_neox': 353, 'n_words': 82}