<commit_before>/**
 * A script to generate `../shared/styles/mathjax.css`.
 *
 * Run using `npm run build:mathjax`.
 */

import fs from 'fs'
// @ts-ignore
import MathJax from 'mathjax-node'
import path from 'path'

const dest = path.join(__dirname, '..', 'shared', 'styles', 'mathjax.css')

MathJax.typeset(
  {
    css: true
  },
  (result: any) => {
    const { errors, css } = result
    if (errors) errors.map(console.error)
    fs.writeFileSync(
      dest,
      `/* Generated by ${path.basename(__filename)}. Do not edit. */\n\n${css}`
    )
  }
)
<commit_msg>chore(Lint): Add minimal result interface<commit_after>/**
 * A script to generate `../shared/styles/mathjax.css`.
 *
 * Run using `npm run build:mathjax`.
 */

import fs from 'fs'
// @ts-ignore
import MathJax from 'mathjax-node'
import path from 'path'

const dest = path.join(__dirname, '..', 'shared', 'styles', 'mathjax.css')

interface Result {
  css?: string
  errors?: string[]
}

MathJax.typeset(
  {
    css: true
  },
  (result: Result) => {
    const { errors, css } = result
    if (errors) errors.map(console.error)
    fs.writeFileSync(
      dest,
      `/* Generated by ${path.basename(__filename)}. Do not edit. */\n\n${css}`
    )
  }
)

{'fraction_non_alphanumeric': 0.17430441898527005, 'fraction_numerical': 0.0, 'mean_word_length': 2.970779220779221, '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': '1744663', 'n_tokens_mistral': 436, 'n_tokens_neox': 433, 'n_words': 112}