<commit_before>function log(...mess) {
  //console.log(...mess)
}
// Lazy-load - we might not need decimal. It's a peerDependency, so the parent
// library must include it if needed - we don't, because many callers don't need
// it.
let Decimal
export function requireDecimal() {
  return Decimal || (Decimal = (function() {
    // Allow node callers to inject their own decimal.js
    //if (global && global.Decimal) {
    //  log('swarm-numberformat decimal.js: Found global.Decimal')
    //  return global.Decimal
    //}
    // `nwb.config.js: extenals` ensures this points to window.Decimal for umd (`<script src="...">`) builds
    log('swarm-numberformat decimal.js: trying require()')
    return require('decimal.js')
  })())
}
<commit_msg>allow global decimal.js<commit_after>function log(...mess) {
  //console.log(...mess)
}
// Lazy-load - we might not need decimal. It's a peerDependency, so the parent
// library must include it if needed - we don't, because many callers don't need
// it.
let Decimal
export function requireDecimal() {
  return Decimal || (Decimal = (function() {
    // Allow node callers to inject their own decimal.js via global, because I am
    // sick to death of trying to wrangle require/webpack/import/etc.
    if (global && global.Decimal) {
      log('swarm-numberformat decimal.js: Found global.Decimal')
      return global.Decimal
    }
    // `nwb.config.js: extenals` ensures this points to window.Decimal for umd (`<script src="...">`) builds
    log('swarm-numberformat decimal.js: trying require()')
    return require('decimal.js')
  })())
}

{'fraction_non_alphanumeric': 0.1406151914626491, 'fraction_numerical': 0.0, 'mean_word_length': 3.194736842105263, 'pattern_counts': {'":': 0, '<': 5, '<?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': '5646597', 'n_tokens_mistral': 482, 'n_tokens_neox': 469, 'n_words': 161}