<commit_before><template>
  <div>
    <slot></slot>
    <span
      v-show="dataVisiable"
      class="vjs__tree__node"
      @click.stop="toggleBrackets">
      {{ Array.isArray(data) ? '[' : '{' }}
    </span>
    <span
      v-show="!dataVisiable"
      class="vjs__tree__node"
      @click.stop="toggleBrackets">
      {{ doubleBracketsGenerator(data) }}
    </span>
  </div>
</template>

<script>
  import bracketsMixin from 'src/mixins/brackets-mixin'

  export default {
    mixins: [bracketsMixin],
    props: {
      showLength: Boolean
    },
    methods: {
      // 双括号内容生成器
      doubleBracketsGenerator (data) {
        const isArray = Array.isArray(data)
        const brackets = isArray ? '[...]' : '{...}'
        if (this.showLength) {
          // 若展示长度, 形如 [...] // 3 items
          const text = isArray
            ? `${data.length} items`
            : `${Object.keys(data).length} keys`
          brackets += ` // ${text}`
        }
        return bracketsFormatter(brackets)<commit_msg>修正语法错误...<commit_after><template>
  <div>
    <slot></slot>
    <span
      v-show="dataVisiable"
      class="vjs__tree__node"
      @click.stop="toggleBrackets">
      {{ Array.isArray(data) ? '[' : '{' }}
    </span>
    <span
      v-show="!dataVisiable"
      class="vjs__tree__node"
      @click.stop="toggleBrackets">
      {{ doubleBracketsGenerator(data) }}
    </span>
  </div>
</template>

<script>
  import bracketsMixin from 'src/mixins/brackets-mixin'

  export default {
    mixins: [bracketsMixin],
    props: {
      showLength: Boolean
    },
    methods: {
      // 双括号内容生成器
      doubleBracketsGenerator (data) {
        const isArray = Array.isArray(data)
        let brackets = isArray ? '[...]' : '{...}'
        if (this.showLength) {
          // 若展示长度, 形如 [...] // 3 items
          const text = isArray
            ? `${data.length} items`
            : `${Object.keys(data).length} keys`
          brackets += ` // ${text}`
        }
        return this.bracketsFormatter(brackets)
{'fraction_non_alphanumeric': 0.16344725111441308, 'fraction_numerical': 0.0009905894006934125, 'mean_word_length': 2.065250379362671, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, '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': '342520', 'n_tokens_mistral': 701, 'n_tokens_neox': 692, 'n_words': 111}